Hi Rudderstack team, I spent a while trying to get...
# support
n
Hi Rudderstack team, I spent a while trying to get the Javascript SDK v3 source to ingest website events with no luck, couldn't get it to receive any events. I then tried the legacy SDK instead and it worked instantly and is receiving events. I was wondering: 1. if there's any known reason why that would be - is there an extra step I need to do beyond adding the SDK to website header with the v3 I'm missing 2. if there are any particular concerns of using the legacy SDK over the v3 SDK Thank you
m
Hey There! 👋 Your message has been received by the RudderStack team. Our standard customer support hours are 9-6 PM EST, but we will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
Hi Solomon, can you share the installing code for v3 that you used?
n
Hi @shy-kite-21035, for sure it is the following with the write key and data plane URL filled in
Copy code
<script type="text/javascript">
        !function(){"use strict";var sdkBaseUrl="https://cdn.rudderlabs.com/v3";var sdkName="rsa.min.js";var asyncScript=true
        ;window.rudderAnalyticsBuildType="legacy",window.rudderanalytics=[]
        ;var e=["setDefaultInstanceKey","load","ready","page","track","identify","alias","group","reset","setAnonymousId","startSession","endSession"]
        ;for(var t=0;t<e.length;t++){var n=e[t];window.rudderanalytics[n]=function(e){return function(){
        window.rudderanalytics.push([e].concat(Array.prototype.slice.call(arguments)))}}(n)}try{
        new Function('return import("")'),window.rudderAnalyticsBuildType="modern"}catch(a){}
        if(window.rudderAnalyticsMount=function(){
        "undefined"==typeof globalThis&&(Object.defineProperty(Object.prototype,"__globalThis_magic__",{get:function get(){
        return this},configurable:true}),__globalThis_magic__.globalThis=__globalThis_magic__,
        delete Object.prototype.__globalThis_magic__);var e=document.createElement("script")
        ;e.src="".concat(sdkBaseUrl,"/").concat(window.rudderAnalyticsBuildType,"/").concat(sdkName),e.async=asyncScript,
        document.head?document.head.appendChild(e):document.body.appendChild(e)
        },"undefined"==typeof Promise||"undefined"==typeof globalThis){var d=document.createElement("script")
        ;d.src="https://polyfill.io/v3/polyfill.min.js?features=Symbol%2CPromise&callback=rudderAnalyticsMount",
        d.async=asyncScript,document.head?document.head.appendChild(d):document.body.appendChild(d)}else{
        window.rudderAnalyticsMount()}window.rudderanalytics.load("WRITEKEY","DATAPLANEURL",{})}();    
</script>
m
Do you see any errors when you use the v3?