Skip to content

Instantly share code, notes, and snippets.

View sglabsmarketing's full-sized avatar

sglabsmarketing

View GitHub Profile
@sglabsmarketing
sglabsmarketing / welcome-series
Created March 22, 2016 15:19
Sending a Welcome Series with Threads
threads.identify('12345678', { email: 'user@example.com' });
@sglabsmarketing
sglabsmarketing / slack-aws
Created March 21, 2016 20:05
Posting to Slack with Threads and AWS
{
"workflow": {
"name": "Example Workflow"
},
"user": {
"traits": {
"name": "Example User",
"job_title": "Engineer",
"email": "user@example.com"
},
@sglabsmarketing
sglabsmarketing / step2b.js
Created March 21, 2016 18:55
Use Threads to Send an Account Verification Reminder: Step 2b
<script type="text/javascript">
threads.identify('12345678', { email: 'user@example.com' }, null
function() {threads.track('Verified Account', {})});
</script>
@sglabsmarketing
sglabsmarketing / step2a.js
Last active March 21, 2016 18:55
Use Threads to Send an Account Verification Reminder: Step 2
<script type="text/javascript">
threads.identify('12345678', { email: 'user@example.com' }, null,
function() {threads.track('Sign Up', {})});
</script>
@sglabsmarketing
sglabsmarketing / step1.js
Created March 21, 2016 18:47
Use Threads to Send an Account Verification Reminder: Step 1
<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>