Integrating Permutive with Segment

If you've already got Segment installed on your site, we've got a simple way to get your events into Permutive too.

We don't have an integration with Segment's dashboard, but a feature of their JavaScript Integration allows you to send any events you track with Segment into Permutive.

It's really simple to set up. Just replace the standard Permutive script with this one. There are two things to remember:

  1. It's important you put it after your Segment script.
  2. Replace PROJECT_ID with your Project ID and API_KEY with your API Key.
!function(t,e){e||(e=e||{},window.permutive=e,e.q=[],version="1.0",e.init=function(n,r,i){e.config={projectId:n,apiKey:r,environment:i||"production"};for(var o=["addon","defineEntities","events","identify","track","trigger","query","ready","onEntry","onExit","everyTime"],a=0;a<o.length;a++){var c=o[a];e[c]=function(t){return function(){var n=Array.prototype.slice.call(arguments,0);e.q.push({functionName:t,arguments:n})}}(c)}var s=t.createElement("script");s.type="text/javascript",s.async=!0;var p="https:"==t.location.protocol?"https://d3alqb8vzo7fun.cloudfront.net":"http://cdn.permutive.com";"development"===i&&(p="https://s3.amazonaws.com/cdn.permutive.com"),s.src=p+"/"+n+"-"+version+".js";var u=t.getElementsByTagName("script")[0];u.parentNode.insertBefore(s,u),analytics&&analytics.on("track",function(t,n,r){e.track(t,n)})})}(document,window.permutive),permutive.init("PROJECT_ID","API_KEY");

And that's it! You'll now be tracking events into Permutive. If you're using our 'Web' or 'Publisher' integrations, you might want to turn them off to avoid generating duplicate events.

If you have any questions on getting set up, get in touch.

Christiaan Hendriksen

Writing guides and tutorials to help you get the most out of Permutive. Get in touch at christiaan@permutive.com.

London

Subscribe to Permutive Blog

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!