Introduction
Using Server Side Tracking with Axeptio offers many advantages:
Extended cookie lifetime: Axeptio cookies are placed server-side, which reduces the risk of deletion by client-side blocking mechanisms, especially with Safari and ITP
Bypass ad blockers: By calling the SDK from a client-specific subdomain, ad blockers can be bypassed.
Improved compliance: Using a custom domain for SDK and consent API calls strengthens privacy and transparency for users.
Prerequisites
Before you begin, you will need:
Axeptio Tag (Client Side): Available in the Template Gallery: Axeptio CMP
Axeptio Client sGTM (Server Side): Available from the GitHub repository: axeptio-client-sgtm-public-template.
Axeptio Tag sGTM (Server Side) : Available in the Template Gallery or on GitHub: axeptio-sgtm-public-template.
Step 1: Configure the transport URL (postConsentUrl)
The first step is to define the URL that will be used as the transport URL, similar to configuring a GA4 tag. Here is how to configure the transport URL:
In your Axeptio SDK configuration settings, add the postConsentUrl parameter with your server-side infrastructure URL. This parameter allows you to redirect consent requests to your own infrastructure, avoiding the use of third-party URLs and strengthening privacy.
Set the server-side URL in Axeptio settings:
If you are using our GTM template (Recommended)
If you integrate Axeptio in HTML, add in the axeptioSettings
Step 2: Install the Axeptio client on the server side
The second step is the installation of the Axeptio client on the server side, which will allow you to manage cookies and consents directly via your server.
Download the Axeptio client for Server-Side GTM:
Go to the Axeptio GitHub repository: axeptio-sgtm-public-template.
Follow the installation and configuration instructions to integrate this client into your server-side infrastructure.
This client will be alongside the GA4 client and will claim Axeptio requests
Step 3: Add the Axeptio Tag in Server-Side GTM
After installing the client on the server side, it is necessary to configure the Axeptio tag in your Server-Side GTM container.
Get the Axeptio Tag:
You can download the Axeptio tag from the Template Gallery or the GitHub repository: https://github.com/axeptio/axeptio-sgtm-public-template
Adding the Tag in GTM:
Import the Axeptio tag template into your GTM container.
No configuration required, everything is already integrated
Step 4: Configure the trigger for the Axeptio client
To ensure that the tag executes correctly, it is important to configure the appropriate trigger in GTM.
Configure a client call trigger:
Create a trigger in sGTM that will be triggered on each call from the Axeptio client.
This trigger will activate the Axeptio tag as soon as a consent event is detected by the Axeptio client.
Testing and validation:
Test the configuration by entering preview mode in GTM and verify that consent events are properly recorded on the server side.
Make sure cookies are placed correctly and that tracking respects user consent preferences.
How to verify my Server Side sGTM installation?
Launch the preview on the client side and server side to see if the requests are being sent correctly and arriving at their destination.
Step 1: Outgoing request
Launch the preview on the client side. Once your site is loaded, open the developer console and load the network section (Network). When you confirm your consent, a request will be sent via the network to your Server Side infrastructure.
Step 2: Incoming request
Your server-side preview will see a new request arrive, it will be claimed by the Axeptio client which will then allow the tag to be loaded.
Conclusion
By following these steps, you have configured Server Side Tracking with Axeptio. This allows you to extend the lifetime of Axeptio cookies, bypass ad blockers, and improve user privacy by using a custom transport URL.
Feel free to regularly check server logs to ensure proper operation and adjust the configuration if necessary. You now have a robust solution for managing consent and cookies in a secure and efficient way! 🎉🚀
