Assign Marketing Cookies to one user id
Assigning Marketing Cookies to one User id
AdPage offers the possibility to link all marketing cookies to a user based on an ID. This way, by providing an ID in the webhook, all cookies can be automatically added.
Adding scripts
These scripts are necessary for the setup
<script defer src="https://[GEKOPPELDE_DOMEIN_NAAM]/user-data-minified.js"></script>
<script defer src="https://[GEKOPPELDE_DOMEIN_NAAM]/visitor-identity.js"></script>
This gives you access to the following Javascript functionalities
window.taggingSaveVisitor(USER_ID);
After calling this function, all cookies will be linked to the user ID. You can call this function as often as you like. We recommend executing it once when the page loads and once just before the checkout process begins.
Connecting a Webhook
To then retrieve the cookies in the webhook and forward them to Google Tag Manager, you need to add the following field:
ap_visitor_id: ZELFDE_WAARDE_ALS_IN_JAVASCRIPT
Once this field is added to the webhook and the webhook is sent to /order_created or /order_refunded, all cookies will automatically be added to the webhook.
Updated on: 15/08/2024
Thank you!