Rockerbox UID to GTM Data Layer
If you need to use the Rockerbox UID in a GTM Tag, you can follow these steps to get that value available as a GTM Variable.
- Create a new Tag in GTM with the following HTML:
<script>
var rbuidSet = function(obj){
var rbuid = !!obj && obj.rbuid;
if (!!rbuid) {
window.dataLayer.push({
event: "rbuidSet",
rbuid: rbuid
})
}
}
window.rbuidSet = rbuidSet;
</script>
<script src="https://getrockerbox.com/jpuid?jsonp=window.rbuidSet"></script>
Set the Tag to fire on All Pages.
- Create a GTM variable for the
rbuid
Data Layer variable set above.
- Create a Trigger that fires when the
Rockerbox UID
variable is set.
- Finally, use the
Rockerbox UID
GTM Variable in the Tag that you need.