It's now possible to add your own preferred tracking for your NEXD Campaign Manager creatives. Please bear in mind that implementing this additional tracking layer to your NEXD Campaign Manager tags is a little bit on the technical side. If you have any questions after reading this article please feel free to reach out to the support team directly.

There's a number of reasons why you may want to add additional, 3rd party tracking to your creatives. You may, for example, have a partner agreement that requires tracking creatives using a specific platform. In any case, gathering tracking and analytics from more than one source is always good practice.
By gathering data from multiple sources it gives you a frame of reference to compare and contrast numbers.

Implementation Methods

There are three methods for implementing 3rd party tracking for NEXD Campaign Manager generated tags - two JavaScript methods and one image-based.

  1. Javascript Method 1 (Simplest)
  2. Javascript Method 2 (Technical)
  3. Image Method (Simple)

Javascript Method 1 (Simplest)

Add one of the two parameters to the tag:

  • data-onEvent="[JS Function Name - this is what gets called out, function has to be global]" - every event initiation is called out on this function/url
  • data-onEvent-[EventName]="[JS Function Name]" - EventName (remove []) can be either Click, Gyro, CTR or something else, for more insight, please contact Adcanvas Support for more accurate information

Extra parameter:

  • data-unique-events="[true/false]" - if your provided tracking is only called on unique events. (Default on URL true, JS function false)

JS Function will receive two arguments. Example for Javascript tracking:

<script>
window.adcEvents = function(category,action) {
sendMyEvent(category,action);
}
</script>
<script src="mraid.js"></script>
<ins class="adcads"
     data-adc-id="v2iW1mZH1LXpF"
     data-unit="v2iW1mZH1LXpF"
     data-clickable="true"
     data-close-timer="5"
     data-click-tracker="YOURCLICKURLHERE"
     data-interstitial="true"
     data-onEvent="adcEvents"
     data-debug="true">
     <script src="https://adcanvas.com/scripts/new_banners.min.js" type="text/javascript"></script>
</ins>                 

Example based on Google Analytics:

<script>
window.adcEvents = function(category,action) {
ga('send','event',category,action);
}
</script>
<script src="mraid.js"></script>
<ins class="adcads"
     data-adc-id="v2iW1mZH1LXpF"
     data-unit="v2iW1mZH1LXpF"
     data-clickable="true"
     data-close-timer="5"
     data-click-tracker="YOURCLICKURLHERE"
     data-interstitial="true"
     data-onEvent="adcEvents"
     data-debug="true">
     <script src="https://adcanvas.com/scripts/new_banners.min.js" type="text/javascript"></script>
</ins>

Javascript Method 2 (Technical) 

All of our tags also send the event to our tag element, which you are able to grab easily, if you have a solid understanding of how Javascript works.

<script src="mraid.js"></script>
<ins class="adcads"
     data-adc-id="v2iW1mZH1LXpF"
     data-unit="v2iW1mZH1LXpF"
     data-clickable="true"
     data-close-timer="5"
     data-click-tracker="YOURCLICKURLHERE"
     data-interstitial="true"
     data-debug="true">
     <script src="https://adcanvas.com/scripts/new_banners.min.js" type="text/javascript"></script>
</ins>
<script>
// Check that the data-adc-id is the same in the tag
document.querySelector('ins.adcads[data-adc-id="v2iW1mZH1LXpF"]').addEventListener("adcanvas.event",function(e) {
/**
* variable data contains event information
* @param category {string} Category of the event
* @param action {string} Action of the event
* @param tag {object} Reference to the tag
* @param timestamp {int} Timestamp when the event was initiated
* @type {object}
*/
var data = e.data;

},false);
</script>

Example based on Google Analytics:

<script src="mraid.js"></script>
<ins class="adcads"
     data-adc-id="v2iW1mZH1LXpF"
     data-unit="v2iW1mZH1LXpF"
     data-clickable="true"
     data-close-timer="5"
     data-click-tracker="YOURCLICKURLHERE"
     data-interstitial="true"
     data-debug="true">
     <script src="https://adcanvas.com/scripts/new_banners.min.js" type="text/javascript"></script>
</ins>
<script>
// Check that the data-adc-id is the same in the tag
document.querySelector('ins.adcads[data-adc-id="v2iW1mZH1LXpF"]').addEventListener("adcanvas.event",function(e) {
/**
* variable data contains event information
* @param category {string} Category of the event
* @param action {string} Action of the event
* @param tag {object} Reference to the tag
* @param timestamp {int} Timestamp when the event was initiated
* @type {object}
*/
var data = e.data;
ga('send', 'event', data.category, data.action);
},false);
</script>

Image Choice (Simple)
Add to one of the two parameters to the tag.

  • data-onEvent="[URL - this is what gets called out, function has to be global]" - every event initiation is called out on this function/url
  • data-onEvent-[EventName]="[URL]" - EventName (remove []) can be either Click, Gyro, CTR or something else, for more insight, please contact ‹ Support for more accurate information

Extra parameter:

  • data-unique-events="[true/false]" - if your provided tracking is only called on unique events. (Default on URL true, JS function false)

With URL it's even easier, you only have to add:

<script src="mraid.js"></script>
<ins class="adcads"
     data-adc-id="v2iW1mZH1LXpF"
     data-unit="v2iW1mZH1LXpF"
     data-clickable="true"
     data-close-timer="5"
     data-click-tracker="YOURCLICKURLHERE"
     data-interstitial="true"
     data-onEvent="https://track.adform.net/adfserve/?bn=CREATIVEID;1x1inv=1;srctype=3;ord=[timestamp]"
     data-debug="true">
     <script src="https://adcanvas.com/scripts/new_banners.min.js" type="text/javascript"></script>
</ins>

URLs can be also populated with Category name and Action name with macros {eventCategory} and {eventAction}.

If you think this article is missing anything, you can let us know in the comments so we can get it updated ASAP or you can always contact our support team directly.

Did this answer your question?