Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Retargeting Criteo Sociomantic split
<script type="text/javascript">
var getCookie = function(name) {
var match = document.cookie.match(new RegExp(name + '=([^;]+)'));
if (match) return match[1];
}
var ab_retarget = getCookie('ab_retarget_v1');
if (ab_retarget == undefined) {
if (Math.round(+new Date() / 1000) % 2) {
ab_retarget = 'sociomantic';
} else {
ab_retarget = 'criteo';
}
document.cookie = "ab_retarget_v1=" + ab_retarget + ';path=/';
}
dataLayer.push({'ab_retarget': ab_retarget});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.