Consentry. Simple, GDPR-compliant cookie consent management.

Segment Javascript snippet

Consentry replaces the Segment Javascript snippet that you have installed in the head tag on your website.

Finding your Segment snippet in the Segment console

In your Segment account, click on the Sources tab on the left hand side of the screen.

Screenshot demonstrating where to find the Sources section within your Segment dashboard.

Select the Javascript source that represents data flowing from your website.

Screenshot demonstrating where to find the Javascript source within your sources list in the Segment dashboard.

Click on the text that says "Add segment to your site - required".

Screenshot demonstrating where to find the Javascript snippet within your Segment console.

That section will expand to display your Segment snippet. It will look like this.

1
2
3
4
5
6
<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","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 t=analytics.methods[e];analytics[t]=analytics.factory(t)}analytics.load=function(e,t){var n=document.createElement("script");n.type="text/javascript";n.async=!0;n.src="https://cdn.segment.com/analytics.js/v1/"+e+"/analytics.min.js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(n,a);analytics._loadOptions=t};analytics.SNIPPET_VERSION="4.1.0";
  analytics.load("YOUR_SEGMENT_WRITE_KEY");
  analytics.page();
  }}();
</script>

Copyright 2020. Consentry Limited, a non-profit company based in Dalston, London, UK.