The performance of a spott is measured on all embedded interactive content. In a reliable and secure way, Spott measures every interaction from page loads, video impressions to asset clicks. All these measurements can be found on the Spott platform if your contract permits this.

In order to measure the conversion rate (e.g. how many purchases were made by Spott), you can capture custom events with your own tracking solution. 

This article will show you:

  • How to implement custom events
  • Measuring with Google Analytics (example)

Capturing custom events 

You can measure spott's performance by putting a code snippet into your HTML code, which enables you to integrate your custom event tracking. The custom event you added will get fired whenever a user clicks on an asset in your interactive content.

Code Snippet

Simply copy-paste this code snippet and put it at the bottom of your web page.

<script>
var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
var eventer = window[eventMethod];
var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message";

eventer(messageEvent,function(e) {
  var payload = e.data;
  if (payload.event_type === "spottButtonAction") {

    /* Your custom tracking here */

  }
}, false);
</script>

In this snippet, the script won't do anything just yet. Replace /* Your custom tracking here */  with your own Javascript event tracking or with the Google Analytics snippet below.

Try replacing /* Your custom tracking here */  with console.log(payload);  and open your console to see what data you can use to track events.

Measuring with Google Analytics

When using Google Analytics' Events, you can easily create your own custom measurements.

In able for this method to work, your page must have Google Analytics already enabled on your website.
An example might look like this:

gtag('event', 'Spott',{
  'event_category':'Buy click',
  'event_label':payload.event_data.asset
});

You can take this working example as is and use it in the code displayed above by replacing /* Your custom tracking here */  with this code snippet.

The overall results can be viewed in the Behaviour > Events  tab on your Google Analytics page.

It's good to know that Google Analytics only allows you to see events after about 24 hours. However, you can see them come in Realtime. Go to Realtime > Events  on your Google Analytics Page. 

Did this answer your question?