This article is part of the Integration series.
Before following the guide below, please make sure you have reviewed the general overview article Choose your Axeptio integration method.
â ïž Warning! This integration method is not the one we recommend in most cases.
Hard-coding the Axeptio script should be reserved for specific technical contexts (highly customized sites, particular constraints, environments without tag managers, etc.) and for people with minimum technical skills.
đ If this is not your case, or if you have any doubt, we strongly recommend using the recommended integration methods (Google Tag Manager, CMS plugins, etc.), which are simpler to maintain and evolve.
Before proceeding, take time to review the article Choose your Axeptio integration method to ensure this approach is right for your project.
Are you already loading Axeptio via another method (GTM, CMS plugin, or other)? In that case, you do not need to follow this guide.
Get your widget script
Your widget script is the piece of code you need to insert on your site to display your widget.
To get it, it's very simple:
In the Axeptio admin panel, open your project.
In the left menu, click on "Integration", then click on the "General" tab.
In the "Banner Configuration" dropdown, select the banner configuration you want to apply.
That's it! Like magic, the script appears! There's even a small "Copy" button to make your life easier đ
Integrate and publish the script
Now that you have the script in hand, all that's left is to integrate it on your site đ»
You can integrate the Axeptio script into your site's code in one of two ways:
Just before the closing </body> tag
This option helps minimize performance impact and is suitable when other services (analytics, marketing, etc.) are also loaded at the bottom of the page.
Inside the <head> tag
This option is preferred when certain services or third-party tags (such as Google Analytics 4 or Google Tag Manager) are loaded early on the page and depend on consent information.
â ïž Important note about script placement and sequencing
Pay special attention to the placement of the Axeptio script on your pages, in relation to other services that depend on it.
Some solutions, such as Google Analytics 4, recommend integrating their tag directly in the <head> so it loads as early as possible. If a GA4 tag (or any equivalent service) is loaded before Axeptio has been able to set Consent Mode signals, the first requests will be sent without consent signals, which will result in non-compliance.
To avoid any sequencing issues, make sure Axeptio is loaded at least as early as, and ideally before, any third-party service or tag that depends on consent information.
This ensures that consent signals are properly set before these services execute.
