JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://unpkg.com/glottologist"></script>
hi!
JavaScript
(function(){
var integrations=window.integrations=window.integrations||[];if(integrations.loaded){return}if(integrations.invoked){return}integrations.invoked=true;integrations.methods=["identify","setContext","set","get","do"];integrations.factory=function(method){return function(){var args=Array.prototype.slice.call(arguments);args.unshift(method);integrations.push(args);return integrations}};for(var i=0;i<integrations.methods.length;i++){var key=integrations.methods[i];integrations[key]=integrations.factory(key)}integrations.load=function(siteId){integrations.siteId=siteId;var script=document.createElement("script");script.type="text/javascript";script.async=true;script.src="https://cdn.integrationsjs.com/dist/boot.js";var first=document.getElementsByTagName("script")[0];first.parentNode.insertBefore(script,first)};
// Load Integrations.js with your API key
integrations.load('pk_d19ab77b09728146fb083277dff8d8fb');
// Identify the user by their unique ID
integrations.identify({
userId: 'UNIQUE ID FOR USER' // email/username/userid
});
// Call setContext whenever the context of the page changes
// This can be called any number of times
integrations.setContext({
people: [{
email: '[email protected]',
name: 'Jason Tokoph'
}],
title: 'So many integrations, so little time',
description: 'Take a look at integrationsjs.com',
datasets: {
foo: [['name', 'age'], ['jason', 29]]
}
});
})();