Installation instructions - Standalone
Paste the script copied in the previous step before sending a page_view.
The Adloop script will drop a cookie containing the values to send to Analytics. You have to manually retrieve the value of the cookie and add it to your Analytics call.
1. Using a function just before the page_view event
There is now a new function that you can call anywhere you want. This function automatically fills the custom dimensions when using GTAG, GA or PA analytics objects.
It is mandatory to call this function just before the page view event and any other event.
if(typeof window._ADLOOP_SET_CUSTOM_DIMENSIONS != "undefined"){
window._ADLOOP_SET_CUSTOM_DIMENSIONS(true);
}
2. Using the stored values
In case of a specific setup, it is also possible to set the custom dimensions manually.
It is mandatory to write this code just before the page view event and any other event.
The Adloop dimensions values are stored in a variable called (you write this in the console debugger of your browser if you want to see what’s inside) :
window.__ADLOOP_VALUES__
For example (in this case, the example implements the queue system of Piano, ‘paq’) :
if(typeof(__ADLOOP_VALUES__) != "undefined" {
var adloopValues = window.__ADLOOP_VALUES__
window._paq.push(['setProperty', adloopValues.clickDimension, adloopValues.clickCode])
window._paq.push(['setProperty', adloopValues.clickDimensionMeta, adloopValues.clickCodeMeta])
}
Please note, this code must be added after the Adloop script and before sending the page_view