Skip to content

Instantly share code, notes, and snippets.

View threadsio's full-sized avatar

Threads.io threadsio

View GitHub Profile
<script>
threads.track('Signed Up', {
plan: 'Platinum',
source: 'social',
payment_type: 'annual'
});
</script>
<script>
threads.track('Signed Up', {});
</script>
<script>
threads.identify('12345678', {
email: 'user@example.com',
name: 'Example User',
state: 'CA',
country: 'US',
dob: '1980-01-01',
plan: 'gold',
sign_up_date: '2015-05-01'
});
<script>
threads.identify('12345678', { email: 'user@example.com' });
</script>
@threadsio
threadsio / threads-tracking.js
Created October 16, 2015 14:41
Threads JavaScript Snippet
<script type="text/javascript">
!function(o,n){function i(o){return function(){return threads.push({m:o,args:Array.prototype.slice.call(arguments)}),threads}}var threads=o.threads=o.threads||[];if(!threads.initialize){if(threads.invoked)return void(o.console&&console.error&&console.error("threads snippet included twice."));threads.invoked=!0;for(var c=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","group","track","ready","alias","page","once","off","on"],p=0;p<c.length;p++){var l=c[p];threads[l]=i(l)}
threads.load=function(o){var i=n.createElement("script"),c="https:"===n.location.protocol?"https://":"http://";i.type="text/javascript",i.async=!0,i.src=c+"cdn.threads.io/analytics/"+o+"/threads.min.js";var p=n.getElementsByTagName("script")[0];p.parentNode.insertBefore(i,p)},threads.SNIPPET_VERSION="1.1.0",
threads.load("FROM_YOUR_THREADS_ACCOUNT"),
threads.page()}}(window,document);
</script>
<script type="text/javascript">
threads.identify('12345678', { email: 'user@example.com' }, null
function() {threads.track('Verified Account', {})});
</script>
<script type="text/javascript">
threads.identify('12345678', { email: 'user@example.com' }, null,
function() {threads.track('Sign Up', {})});
</script>
<script type="text/javascript">
!function(o,n){function i(o){return function(){return threads.push({m:o,args:Array.prototype.slice.call(arguments)}),threads}}var threads=o.threads=o.threads||[];if(!threads.initialize){if(threads.invoked)return void(o.console&&console.error&&console.error("threads snippet included twice."));threads.invoked=!0;for(var c=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","group","track","ready","alias","page","once","off","on"],p=0;p<c.length;p++){var l=c[p];threads[l]=i(l)}
threads.load=function(o){var i=n.createElement("script"),c="https:"===n.location.protocol?"https://":"http://";i.type="text/javascript",i.async=!0,i.src=c+"cdn.threads.io/analytics/"+o+"/threads.min.js";var p=n.getElementsByTagName("script")[0];p.parentNode.insertBefore(i,p)},threads.SNIPPET_VERSION="1.1.0",
threads.load("XYZ"),threads.page()}}(window,document);
</script>