Lotame integration

If you intend to utilize the Data Collection API aspects of Lotame and add predicted profile as demographic variables please follow this guide for implementation.

Abstract

This integrations happens on publisher side and requires our master script be loaded to websites. Both inline or TAG-managers delivery are working perfectly. Master script typically looks like:

<script src="https://sak.userreport.com/youcompany/launcher.js" async id="userreport-launcher-script"></script>

For data Lotame's Data Collection API you need to use Lotame advanced tag. Simpliest Lotame tag looks like this and it is assumed it is already deployed to your websites.

<script src="http://tags.crwdcntrl.net/c/0/cc.js?ns=_cc0" id="LOTCC_0"></script>
<script>
_cc0.bcp();
</script>

_cc0 is a tracker object which depends on your Lotame account ID, and will be different for you.

Lotame does not allow to put labels on sent data and we are not allowed provide demographics in plain text, therefore we are using semi-obfuscated key-values (see below)

Implementation

  1. In order to avoid any additional coding, our main script will set targeting data to localStorage cache and we provide function that takes data from cache and sends to Lotame
    • it means that first time we see user that have predicted profile - profile is cached but not sent to Lotame
    • profile is sent to Lotame on all subsequent pageviews
  2. After implementing our main script, your development team need to integrate the below function into the Lotame snippet

 

Lotame function 

Here is a function that takes data from cache and sends to Lotame

function addAudienceProjectDataToLotame(cc, prefix) {
	var CACHE_KEY = "apr_lotame";
	prefix = prefix ? prefix + ":" : "";
	try {
		var json = window.localStorage.getItem(CACHE_KEY);
		if (json) {
			var cache = JSON.parse(json);
			if (cache.exp > Date.now()) {
				cache.d.forEach(function (dem) {
					cc.add("dem", prefix + dem);
				});
			}
			else {
				window.localStorage.removeItem(CACHE_KEY);
			}
		}
	}
	catch (err) {
		window.localStorage.removeItem(CACHE_KEY);
	}
}

This function needs be called with your Lotame's _ccXX tracker prior to .bcp() call in your Lotame implementation. Like this

<script src="http://tags.crwdcntrl.net/c/0/cc.js?ns=_cc0" id="LOTCC_0"></script>
<script>
/*
Following invocation will add AudienceProject demographic dimensions like
_cc0.add("dem", "gndr:m_150");
_cc0.add("dem", "yrs:30max_150");
*/
addAudienceProjectDataToLotame(_cc0); 
_cc0.bcp();
</script>

If you want to put our dimensions into separate bucket in Lotame, you can specify optional prefix, like following:

/*
Following invocation will add AudienceProject demographic dimensions like
_cc0.add("dem", "AudienceProject:gndr:m_150");
_cc0.add("dem", "AudienceProject:yrs:30max_150");
*/
addAudienceProjectDataToLotame(window._cc0, "AudienceProject"); 

Semi-obfuscation

Semi-obfuscation is compromise between plain demographics and AudienceData default obfuscated key-values (e.g. ap_a:1, ab_b:3). Here is few examples:

  • gndr - Gender
    • m - male
    • f_150 - female, affinity 150
  • yrs - Age
    • 1824 - from 18 to 24
    • 30max_150 - <30, affinity  150
    • 50min_200 - >50, affinity 200

You can request vocabulary from your account manager.

 

Testing

Integration is performed by development team on publisher side therefore we ensured that integration can be tested on non-production environment.

On our end we implemented following debug helper to verify implementation. You can fill cache with fake data by entering page with our script present with parameter ?__sak_fakeads=1,3,5,random5 like http://example.com/?__sak_fakeads=1,3,5,random5. It will put key-values with ids 1, 3, 5 and random 5 from vocabulary. You can modify these parameters. Test scenario would be following:

  1. Add addAudienceProjectDataToLotame function and its invocation to Lotame snippet
  2. Enter http://example.com/?__sak_fakeads=1,3,5,random5 so something is put into cache
  3. Reload the page, so snippet will capture data from cache and send to Lotame
  4. Demographic variables should appear in Lotame (when size is sufficient in their eyes)

Further questions

If you are experiencing issue with implementing integrations send us request to integrations@audiencedata.com and our professional support team will help you.

Attachments

Comments

Powered by Zendesk