ABTasty provides a number of native Integrations for most used 3rd party analytics, but if your analytic service is not in our native Integration list, then our Custom Integration Connector is here to help you. The purpose of a Custom Integration is to share campaign and variation information from ABTasty to your analytic service. This Custom Integration is enabled by the writing of a piece of JavaScript code that will be run by our tag every time a visitor is exposed to a variation.
Creating a Custom Analytic Integration
Start by click on then Integrations > Web Analytics tools, and scroll to the bottom of the page where you’ll see this menu
Click “Add a Custom Integration” to open the Custom Integration setup.
Give your Integration a name, write the Integration code using ABTasty’s variable, and Save.
To learn more about the Integration code, go to the “Writing the Custom Integration code” section of this page.
Below is an example for a fictional service called “Action360 Analytic”
Your Custom Integration will now appear in the list of available Integrations
It will also be shown in the list of available Integration in the “Advanced options” step of your campaign setup
Changing a Custom Integration
Your Custom Integrations can be modified or even removed if necessary, you have full control over them. These actions are available on the Settings > Integrations > Web Analytics tools page, at the bottom of the page
If you modify the code of a Custom Integration, the change will apply to all campaigns on which the Integration is active. We don’t keep track of previous versions of a Custom Integration code, so be careful with your changes. The same applies for deletion: if you delete your Integration, it will also be removed from all campaigns currently using it.
👍 |
Don’t forget to refresh your tag after making changes to your Custom Integrations in order to apply them immediately. |
Writing the Custom Integration code
The code of a Custom Integration is a JavaScript code that is executed by our tag every time a visitor is exposed to a variation. Writing this code requires some basic knowledge of JavaScript, as well as knowing which API is provided by the Analytic service you want to integrate with. If you don’t know which API to use, you can send this documentation to someone working at your Analytic service provider, it will greatly help them answer you.
This code has access to some built-in variables that will be replaced at runtime by our tag. These variables include:
- {{campaignId}}: the id of the campaign
- {{campaignName}}: the name of the campaign
- {{variationId}}: the id of the variation (or 0 if it is the original)
- {{variationName}}: the name of the variation
If a visitor is exposed to two campaigns on the same page, the code will be executed twice.
For example, let’s say you write this code in your Custom Integration:
console.log('Custom Integration code\n')
console.log('Campaign Name : %s\n', {{campaignName}})
console.log('Campaign Id : %s\n', {{campaignId}})
console.log('Variation Name : %s\n', {{variationName}})
console.log('Variation Id : %s\n', {{variationId}})
If you then browse the page with two active campaigns using the integration, this is what you will see on your developer console:
Comments
0 comments
Please sign in to leave a comment.