Adobe Analytics
This document provides a basic integration guide for using HUMAN’s binary result flag to enrich Adobe Analytics.
Prerequisites
- Appropriate access in Adobe Analytics to create Conversion Variables (eVars)
- Access to update your website code
- Score reporting enabled and set to binary with a threshold of 100
- If you want to also send enriched data, then you need data classification enrichment enabled
JavaScript integration
The data from HUMAN is returned as an event. To receive the event, you must store the following functions in an Adobe eVar.
Note
APPID
will be equal to your app ID. For example if your APPID isPX12345678
, then your function variable will bewindow.PX12345678_asyncInit
.
window.APPID_asyncInit = function(px) { // replace with your app ID
px.Events.on('score', function(score) {
// Set your action for the score here
// The score can go to another variable or function
try {
// Set eVar for Adobe
window.digitalData.page.pageInfo.attributes.pxbs = score;
} catch (err) {
console.log("error: " + err);
}
});
};
px.Events.on('enrich', function (value) {
// value - the enriched data, in the form of <HMAC>:<Base64 encoded data>
const base64Data = value.split(":")[1]; // split value to get the base64 encoded data
const dataStr = atob(base64Data); // base64 decode the enrichment data
const data = JSON.parse(dataStr); // get the data as JSON
window.digitalData.page.pageInfo.attributes.pxfId = data['f_id']; // get f_id data
console.log('DATA', data);
});
Add the JS to your domain
The JavaScript integration can be added to your existing HUMAN JavaScript snippet.
<script type="text/javascript">
(function() {
// Adobe Integration added here
window.PX12345678_asyncInit = function(px) {
px.Events.on('score', function(score) {
// Set your action for the score here
// The score can go to another variable or function
try {
// Set eVar for Adobe
window.digitalData.page.pageInfo.attributes.pxbs = score;
} catch (err) {
console.log("error: " + err);
}
});
};
// Custom parameters
// window._pxParam1 = "<param1>";
var p = document.getElementsByTagName('script')[0],
s = document.createElement('script');
s.async = 1;
s.src = '//client.perimeterx.net/PX12345678/main.min.js';
p.parentNode.insertBefore(s, p);
}());
</script>
Updated 1 day ago