Developer Hub

Welcome to the Synerise developer hub. Add extraordinary value to Your business with a Synerise integration, webhooks, API or customize Synerise for Your organization

Get Started

Generic events

In the previous step, you prepared your tracking code. Now it's time to put it on the site and start monitoring your users' activity.

Embedding tracking code

This is how your tracking code looks like:


<script>
    function onSyneriseLoad() {
        SR.init({
            'trackerKey':'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
      });
    }

    (function(s,y,n,e,r,i,se){s['SyneriseObjectNamespace']=r;s[r]=s[r]||[],
     s[r]._t=1*new Date(),s[r]._i=0,s[r]._l=i;var z=y.createElement(n),
     se=y.getElementsByTagName(n)[0];z.async=1;z.src=e;se.parentNode.insertBefore(z,se);
     z.onload=z.onreadystatechange=function(){var rdy=z.readyState;
     if(!rdy||/complete|loaded/.test(z.readyState)){s[i]();z.onload = null;
     z.onreadystatechange=null;}};})(window,document,'script',
     '//www.snrcdn.net/sdk/3.0/synerise-javascript-sdk.min.js','SR', 'onSyneriseLoad');
</script>

You should paste it before the </body> closing tag in your website code.

Multiple websites

Remember, if you have several websites with different domain be sure you paste the right tracking code.

Embedding tracking code with Google Tag Manager

You can , embed our tracking code using Google Tag Manger.

  1. If you already have GTM configurated, click Add new tag in GTM Panel.
  1. Add Custom HTML code

  2. Paste Synerise tracking code

  3. Click Advanced and choose Once per event

  4. Click Trigger and choose All Pages

  5. Save and publish your container

Embedding tracking code at SPA

The default JavaScript tracking snippet works well with traditional websites because the snippet code is run every single time the users load a new page.
However, for a Single Page Application where the site loads new page content dynamically rather than as full page loads, the snippet code only runs once. This means subsequent (virtual) page views must be tracked manually as new content is loaded.


What's Next

Generic events are not enough? Let's make a custom events and send them to Synerise.

Custom events

Generic events