Skip to main content

Embed the Axeptio script on your site

Manon Manso avatar
Written by Manon Manso
Updated over 3 weeks ago

This article is part of the Integration series.

Before following the guide below, make sure you have read the general overview article Choose your Axeptio integration method.

⚠️ Warning! This integration method is not the one we recommend in most cases.

Embedding the Axeptio script directly into your site should be reserved for specific technical contexts (highly customized websites, particular constraints, environments without a tag manager, etc.) and for users with a minimum level of technical skills.

👉 If this is not your case, or if you are unsure, we strongly recommend using one of the recommended integration methods (Google Tag Manager, CMS plugins, etc.), which are easier to maintain and evolve over time.

Before going any further, take the time to read the article Choose your Axeptio integration method to make sure this approach is the right fit for your project.

Are you already loading Axeptio using another method (GTM, CMS plugin, or other)? If so, you do not need to follow this guide.

Get your widget script

The widget script is the piece of code you need to insert on your site to display your widget.

Getting it is super simple:

  1. In the Axeptio admin, open your project.

  2. In the left-hand menu, click Integration, then go to the General tab.

  3. In the Banner configuration dropdown, select the banner setup you want to apply.

That’s it! Like magic, the script appears! There’s even a handy Copy button to make your life easier 😉

Integrate and publish the script

Now that you have the script, all that’s left is to integrate it into your website 💻

You can add the Axeptio script to your site’s code using one of the following two approaches:

  • Just before the closing </body> tag

    This option helps limit the impact on performance and is suitable when other services (analytics, marketing tools, etc.) are also loaded at the end of the page.

  • Inside the <head> tag

    This option should be preferred when certain third-party services or tags (such as Google Analytics 4 or Google Tag Manager) are loaded early in the page and rely on consent information.

⚠️ Important note about script placement and sequencing

Pay close attention to where the Axeptio script is placed on your pages, in relation to other services that depend on it.

Some solutions, such as Google Analytics 4, recommend placing their tag directly in the <head> so it loads as early as possible. If a GA4 tag (or any similar service) is loaded before Axeptio has had a chance to define Consent Mode signals, the initial requests will be sent without consent signals, resulting in non-compliant data collection.

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 relies on consent information.

This ensures that consent signals are properly defined before those services are executed.

Did this answer your question?