Skip to Content
Axeptio Server-Side

Consent optimization: Axeptio Server-Side with Addingwell

Introduction

In an ever-evolving digital environment, managing user consent is essential to ensure both compliance with regulations (GDPR, CCPA) and a smooth experience for internet users. Until now, this collection was done on the client-side, where Axeptio scripts were executed directly in the browser.

However, this approach presents several limitations. Ad blockers often block third-party scripts, which prevents the consent banner from being displayed. Some browsers, such as Safari, reduce the lifespan of cookies to seven days, which requires users to be asked for consent repeatedly.

To address these challenges, Addingwell offers an integration of Axeptio in server-side mode. By shifting cookie management from the browser to the server and loading Axeptio scripts via a first-party CDN, this solution bypasses these blockages and ensures a much longer persistence of consent. This article explores the limitations of current methods and explains how to implement Axeptio server-side with Addingwell.

Proposed solutions

Client-side option and its limitations

The traditional approach relies on directly loading Axeptio scripts in the browser. These scripts are fetched from the axept.io domain and display a consent popup. Once accepted, cookies are set via JavaScript to remember the user’s choice for future visits.

Diagram of the typical Axeptio CMP client-side flow

This solution has several drawbacks. Ad blockers and certain browser policies can sometimes prevent the loading of Axeptio scripts from a third-party domain like axept.io. When an ad blocker is enabled, the popup does not appear and the user cannot express their consent, resulting in a default rejection. Furthermore, Safari and other browsers limit cookie duration to seven days, forcing consent to be requested repeatedly.

Impact of ad blockers on Axeptio CMP server-side

Loading Axeptio via a first-party CDN with Addingwell

To overcome these restrictions, Addingwell proposes an alternative: hosting the Axeptio scripts via a first-party CDN. By placing these scripts on a trusted domain, the risk of interception by ad blockers is reduced. This approach ensures a reliable display of the consent popup and improves the acceptance rate.

Axeptio loading via Addingwell in first-party

However, this solution does not fully resolve the issue of the limited cookie lifespan. Cookies are still set via JavaScript and remain subject to browser restrictions.

Server-side implementation with Axeptio client and tag

The server-side integration represents the most advanced solution to guarantee reliable and durable consent collection. This approach is based on a server-side client that intercepts consent requests, as well as an Axeptio tag on the server side that handles cookie setting.

Functioning of the Axeptio server-side CMP with Addingwell

Thanks to this architecture, Axeptio scripts are still loaded in first-party via the Addingwell CDN, but cookie management is completely shifted to the server. This method eliminates browser restrictions and ensures consent persistence well beyond seven days. It also offers improved resistance to ad blockers, as consent-related interactions are no longer visible in the browser.

In the next section, we will detail the precise steps to implement Axeptio server-side with Addingwell, in order to help you effectively configure your server-side CMP.

Setting up Axeptio Server-Side

Axeptio client configuration

Download the Axeptio client here.

Axeptio client code on Github

Go to your GTM Server container, in the Templates > Client Templates section, click on New.

Button to create a new client template in GTM Server

Then click on the 3 small dots at top right, then on Import.

Button to import a client template into GTM Server

Then select the template.tpl file you’ve just downloaded and click Save.

Button to save a client template in GTM Server

Now go to the Clients section of GTM Server and click on New.

Button to instantiate a client template in GTM Server

Then select the Axeptio client, previously imported.

Selection of previously imported Axeptio client

Click Save to save the client, the name Axeptio will then be proposed, click Save again.

Saving the Axeptio client

Congratulations, the Axeptio client is now installed in your GTM Server container.

Axeptio client installation completed

We’ll now move on to configuring the Axeptio CMP tag, still on GTM Server.

Axeptio CMP tag configuration on GTM Server

Download the Axeptio CMP server tag here.

Axeptio CMP Server tag code on Github

Go to your GTM Server container, in the Templates > Tag Templates section, click on New.

Button to create a new tag template in GTM Server

Then click on the 3 small dots at top right, then on Import.

Button for importing a tag template into GTM Server

Then select the template.tpl file you’ve just downloaded and click Save.

Button to save a tag template in GTM Server

Now go to the Tags section of GTM Server and click on New.

Button to instantiate a tag template in GTM Server

Then select the previously imported Axeptio CMP tag.

Selection of previously imported Axeptio CMP tag

Trigger the tag when the client is equal to Axeptio.

Axeptio CMP tag trigger setup

Then click Save to save the Axeptio CMP tag.

Save Axeptio CMP Server tag

Congratulations, the Axeptio CMP tag is now installed in your GTM Server container. We’ll now move on to configuring the Axeptio CMP tag on GTM Web.

⚠️
At this stage, it is necessary to publish your server container before continuing with the configuration on GTM Web.

Load Axeptio from Addingwell

To be able to bypass ad-blockers, it’s necessary to load the Axeptio script from your Addingwell tagging server.

Go to Addingwell, then to the CDN section. Then click on Add another file.

Add a new file on the Addingwell CDN

Next, enter the URL of the Axeptio SDK.

https://static.axept.io/sdk.js
Step 1: add the third-party url in the Addingwell CDN

Next, enter the path to this file. For example, you could enter axpt.js.

Step 2: adding the path to the Addingwell CDN

Select the cache of your choice (e.g. 10 minutes) then click Save.

You can control how long the Axeptio script remains cached in the CDN before sending a new request to obtain the latest version of the script.

Reducing this time allows you to obtain the latest version of the script more regularly.

Increasing the duration improves performance for your users, as your files are more likely to be served directly from the cache. A longer duration reduces the number of requests sent to Axeptio.

Step 3: cache precision in the Addingwell CDN

You can now access this file by calling the URL https://subdomain.domain.com/axpt.js.

Axeptio loading configuration completed via Addingwell CDN

Axeptio CMP configuration

With Axeptio CMP tag

In your GTM Web container, in the Tags section, click on New.

In the gallery, search for the Axeptio CMP tag.

Add Axeptio CMP to GTM Web

Then click on Add to workspace.

Add Axeptio CMP tag to GTM Web workspace

Go to the GTM Web gallery, add the Axeptio CMP tag.

For this tag to communicate correctly with your server, you need to add your server’s URL (example: https://subdomain.domain.com) in the Server-side section.

Filling the Serve-Side field of the Axeptio CMP tag

In the Cookie settings section, fill in the User cookies domain field with your main domain (e.g. domain.com).

Filling the userCookiesDomain in the Axeptio CMP tag

This tag should be triggrered on Consent Initilization - All Pages.

To modify the script loading URL, you need to modify the Axeptio CMP tag template. To do this, go to Templates on your GTM Web container and click on the Axeptio CMP template.

Modification of Axeptio CMP template

The template editor opens up, go to the Permissions tab and then to the Injects scripts section.

Modification of Axeptio CMP template permissions

Replace the URL with the URL of your Axeptio file, previously added to the Addingwell CDN. In our example: https://subdomain.domain.com/axpt.js. Then click Save.

Loading URL replacement in Axeptio CMP tag

Congratulations, you’ve now completed the configuration of the Axeptio CMP tag.

In Javascript

If you don’t use the tag, here’s the JavaScript equivalent.

Axeptio CMP script
<script> window.axeptioSettings = { clientId: "603a1qb689j987zx136324ha", postConsentUrl: "https://subdomain.domain.com", userCookiesDomain: "domain.com", googleConsentMode: { default: { analytics_storage: "denied", ad_storage: "denied", ad_user_data: "denied", ad_personalization: "denied", wait_for_update: 500 } } }; (function(d, s) { var t = d.getElementsByTagName(s)[0], e = d.createElement(s); e.async = true; e.src = "https://subdomain.domain.com/axpt.js"; t.parentNode.insertBefore(e, t); })(document, "script"); </script>

Known errors and solutions

CORS requests errors

If you’re getting CORS errors, it’s most likely because you haven’t published your server container.

CORS error with Axeptio Server Side

After publishing the server container you should no longer see this error.