Closed jerturowetz closed 1 year ago
Hi @jerturowetz thank you for your report, we start looking into this.
Hi @jerturowetz you need add this code on the <head>
element:
<script>
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"];analytics.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);analytics.push(t);return analytics}};for(var e=0;e<analytics.methods.length;e++){var key=analytics.methods[e];analytics[key]=analytics.factory(key)}analytics.load=function(key,e){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.src="https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n);analytics._loadOptions=e};analytics._writeKey="YOUR_KEY";;analytics.SNIPPET_VERSION="4.15.3";
analytics.load("YOUR_KEY");
analytics.page();
}}();
</script>
Hey @edsonjab
Doesn't including the following load segment on page load and not via the consent manager?
analytics.load("YOUR_KEY");
analytics.page();
Hi there, I'm reporting on the same issue mentioned in #207
The readme states:
However, I am using the Standalone Script which doesn't seem to permit editing the
analytics.methods
array, or, at least, the docs don't indicate how.My implementation is nearly identical to the example code:
I have validated that I am not loading
analytics.js
by any other means.