OneTag for Retail Media Offsite
Introduction
What is OneTag?
The Criteo OneTag is a code snippet to embed in your website's source code or tag management system. It measures and analyzes user interactions on your site. It also loads asynchronously, ensuring no impact on site performance or customer experience.
Common parameters
There are some common parameters which are shared between all the tags:
Event | key | example value | description |
---|---|---|---|
setAccount | account | 12345 | Your Criteo Account or Partner ID, provided by your technical contact, to route data to Criteo servers. |
setRetailerVisitorId | ID | 0193553C0A39937F23FC | A unique, unauthenticated user ID valid for at least 30 days. Used to track visitor behavior across sessions. Typically retrieved via a first-party cookie. |
setCustomerId | ID | 1SDFJI435FH12HFK2 | A consistent, internal ID for logged-in users, linked to accounts, purchase history, or membership programs. |
setEmail | d9c37700(...)18be88 | Userβs email address in SHA256 hash format. |
Tags
Dynamic loader
Add the following script to all pages to load Criteo's JavaScript library, ensuring you populate the placeholder with your dedicated Criteo Partner ID:
<!-- Criteo Loader File -->
<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=#####" async></script>
<!-- END Criteo Loader File -->
Homepage tag
Trigger this tag on the homepage (http://www.retailer.com). Substitute all placeholders with actual values.
<!-- Criteo Loader File -->
<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=#####" async></script>
<!-- END Criteo Loader File -->
<!-- Criteo Homepage Tag -->
<script type="text/javascript">
window.criteo_q = window.criteo_q || [];
window.criteo_q.push(
{ event: "setAccount", account: "12345" }, // Your partner ID
{
event: "setEmail",
email: "d9c378bb0369ee148f7700fc296165d4e8dc356b90ac318be3701ee76f00c588" // User's SHA-256 hashed email
},
{ event: "setCustomerId", id: "1SDFJI435FH12HFK2" }, // User's logged-in ID
{ event: "setRetailerVisitorId", id: "0193553C0A39937F23FC" }, // User's guest ID
{ event: "viewHome" }
);
</script>
<!-- END Criteo Homepage Tag -->
Listing tag
Trigger this tag on all category pages (e.g., https://www.retailer.com/shopping/men) or search result pages. Substitute all placeholders with actual values.
<!-- Criteo Loader File -->
<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=#####" async></script>
<!-- END Criteo Loader File -->
<!-- Criteo Listing Tag -->
<script type="text/javascript">
window.criteo_q = window.criteo_q || [];
window.criteo_q.push(
{ event: "setAccount", account: "12345" }, // Your partner ID
{
event: "setEmail",
email: "d9c378bb0369ee148f7700fc296165d4e8dc356b90ac318be3701ee76f00c588" // User's SHA-256 hashed email
},
{ event: "setCustomerId", id: "1SDFJI435FH12HFK2" }, // User's logged-in ID
{ event: "setRetailerVisitorId", id: "0193553C0A39937F23FC" }, // User's guest ID
{
event: "viewList",
item: [
"123", // First item ID
"456", // Second item ID
"789" // Third item ID
]
}
);
</script>
<!-- END Criteo Listing Tag -->