---
title: 'Switching to the dynamic loader for Criteo OneTag'
description: 'The Dynamic Loader is a JavaScript code snippet that is placed just after the opening <head> HTML tag of a website (typically in a global header include file)…'
language: en
guide: 2khAnEokH0
updated: 2026-08-28T11:13:21Z
canonical: https://help.criteo.com/kb/guide/en/switching-to-the-dynamic-loader-for-criteo-onetag-2khAnEokH0/Steps/775824
alternates:
  de: https://help.criteo.com/kb/guide/de/zum-dynamic-loader-fur-criteo-onetag-wechseln-2khAnEokH0.md
  es: https://help.criteo.com/kb/guide/es/cambiar-al-cargador-dinamico-para-criteo-onetag-2khAnEokH0.md
  fr: https://help.criteo.com/kb/guide/fr/passage-au-dynamic-loader-pour-criteo-onetag-2khAnEokH0.md
  it: https://help.criteo.com/kb/guide/it/come-passare-al-dynamic-loader-per-criteo-onetag-2khAnEokH0.md
  ja: https://help.criteo.com/kb/guide/ja/criteo-tag-dynamic-loader-2khAnEokH0.md
  ko: https://help.criteo.com/kb/guide/ko/criteo-onetag-2khAnEokH0.md
  pt-BR: https://help.criteo.com/kb/guide/pt-BR/migrando-para-o-loader-dinamico-para-criteo-onetag-2khAnEokH0.md
  zh: https://help.criteo.com/kb/guide/zh/criteo-onetag-2khAnEokH0.md
---

> Index of this knowledge base: https://help.criteo.com/llms.txt
>
> Interactive version: https://help.criteo.com/kb/guide/en/switching-to-the-dynamic-loader-for-criteo-onetag-2khAnEokH0/Steps/775824

# Switching to the dynamic loader for Criteo OneTag

<a id="step-775824"></a>

## Switching to the Dynamic Loader Script for Criteo OneTag

[Video](https://criteo.wistia.com/medias/7sxage0hwy)

The Dynamic Loader is a JavaScript code snippet that is placed just after the opening <head> HTML tag of a website (typically in a global header include file) so that it is present and runs on every page of the site. It activates all Criteo tag events that are placed on the different pages of your website, enabling them to work and track the different user activities, so these can be made available in Criteo’s reports.  

The Dynamic Loader is the latest script, replacing the previous older script, known as the Static Loader.

   
Due to its more flexible construction, the Dynamic Loader makes it possible to pass events and other data dynamically, without the limitation of a static setup. This means better and more consistent events tracking and improved measurements of different metrics.  
  
Some benefits of updating to the Dynamic Loader include: 

-   Gradual introduction of new features and improvements to your OneTag library
    
-   Controlled testing to ensure a smooth transition and minimize disruptions
    
-   Flexibility for selective rollout to specific partners and conducting A/B testing
    
-   Real-world testing of new features before official release
    
-   Customization to meet your specific requirements and integrate partner-specific features
    
-   Comprehensive tracking of user activities for improved measurement and insights
    
-   If correctly installed on all the pages of an advertiser's website, it can prevent "tagging gaps", i.e. non \-tagged pages (the Visit event). This can result in an improvement in the measurement of visits, qualified visits, bounce rates, etc, giving better visibility into the user’s journey, which may improve campaign results.

- If "Who needs to update to the Dynamic Loader Script?": [Who needs to update to the Dynamic Loader Script?](#step-3387420)
- If "E-commerce platform process": [E-commerce platform process](#step-853907)
- If "Google Tag Manager process": [Google Tag Manager process](#step-853909)
- If "Direct implementation process": [Direct implementation process](#step-853908)

<a id="step-3387420"></a>

## Who needs to update to the Dynamic Loader Script?

Anyone who is still using the older Criteo Static Loader on their website should update to the Dynamic Loader Script.  
  
You can check for a warning message in the Events section of your Commerce Growth account to check for the need to update. Otherwise, your Criteo account representative might also reach out to you to let you know the need for updating.  
  
You can also check if you're using the Dynamic Loader Script by following the steps:  
  
The first step is to check your website to see which type of Loader Script you have implemented. Normally, Criteo’s Loader Script is placed inside the HTML “<head>” tag, typically inside a “global include file” because this script needs to run (and therefore be applied to) on ALL pages of your website.  
  
It may at times be located inside the HTML "<body>" of pages of your site. This is more common if you are using a Tag Management solution, such as Google Tag Manager.  
  
**Static Loader Syntax looks like:**

`<!-- Criteo Static Loader -->`

`<script type="text/javascript" src="//static.criteo.com/js/ld/ld.js" async="true"></script>`

`<!-- END Criteo Static Loader -->`  
  
**Dynamic Loader Syntax looks like:  
**  
`<!-- Criteo Dynamic Loader -->`

`<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=##partnerId##" async="true"></script>`

`<!-- END Criteo Dynamic Loader -->`

| **Variable** | **Description** | **Example** | **Syntax** | **Required** |
| --- | --- | --- | --- | --- |
| `##partnerId##` | partnerID is a unique ID that can be found in your Commerce Growth Url. | [https://marketing.criteo.com/technical-setup/assets-tags/implementation?advertiserId=93844&partnerId=**101269**](https://marketing.criteo.com/technical-setup/assets-tags/implementation?advertiserId=93844&partnerId=101269) | String | Required |

  
Follow the process as per the status of your Loader Script.

- If "You have the Static Loader implemented in the header": [You have the Static Loader implemented in the header](#step-3387417)
- If "You already have a Dynamic Loader implemented in the header": [You already have a Dynamic Loader implemented in the header](#step-3387421)
- If "You have a Dynamic Loader implemented, but it looks different": [You have a Dynamic Loader implemented, but it looks different](#step-3387423)

<a id="step-853907"></a>

## E-commerce platform process

E-commerce platforms allow you to showcase your products and track your page events through plug-in implementation through Shopify, Prestashop, Magento, or Woo-commerce plug-in.  
  
Follow the steps to reconfigure your plugins with the latest Criteo tags. This process will update the configuration replacing the Static Loader with the newer Dynamic Loader script. 

1.  Select **Reconfigure tags** in the **Events Tracking** section of Commerce Growth.
    

2.  Select **E-commerce platform** and choose your platform. 
    

3.  Complete the steps to re-install the plugin.

Next: [Google Tag Manager process](#step-853909)

<a id="step-853909"></a>

## Google Tag Manager process

Follow the steps to reconfigure your Criteo tags configuration within your Google Tag Manager account. This process will update the configuration replacing the Static Loader, to the newer Dynamic Loader script. 

1.  Select **Reconfigure tags** in the **Events Tracking** section of Commerce Growth.
    

2.  Select **Google Tag Manager** and choose your method. 
    

3.  Complete the steps to re-import or update your container.

Next: [Direct implementation process](#step-853908)

<a id="step-853908"></a>

## Direct implementation process

```javascript
< !-- Criteo Static Loader File -->

<script type="text/javascript"src="//static.criteo.net/js/ld/ld.js"async="true"></script>

<!-- END Criteo Static Loader -->

<!-- Criteo Homepage Tag -->

<script type="text/javascript"> 
window.criteo_q = window.criteo_q || [];
var deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
window.criteo_q.push(
{ event: "setAccount", account: YOUR_PARTNER_ID},
{ event: "setEmail", email: "##Hashed Email Address##", hash_method: "sha256" },
{ event: "setEmail", email: "##Hashed Email Address##", hash_method: "md5" },
{ event: "setSiteType", type: deviceType},
{ event: "viewHome" });
</script>

<!-- END Criteo Homepage Tag -->
```

The Criteo OneTag requires two parts to fire correctly, they are:

-   Loader script
    
-   Event and data collection
    

  
Shown here is an outline of these two parts with a simple homepage event.  
  
This is a homepage tag but the other tags will look similar.

In the example shown, the below-mentioned code is loader and rest is event and data collection.  
  
 `<script type="text/javascript" src="//static.criteo.net/js/ld/ld.js"async="true"></script>`

Next: [New Dynamic Loader script example](#step-1678819)

<a id="step-3387417"></a>

## You have the Static Loader implemented in the header

Here you need to do some extra checks before knowing what updates are necessary.

Next: [Your website uses multiple domains](#step-3387422)

<a id="step-3387421"></a>

## You already have a Dynamic Loader implemented in the header

In this case no changes are needed, your account is already up-to-date.

This path ends here.

<a id="step-3387423"></a>

## You have a Dynamic Loader implemented, but it looks different

If the parameter name that is appended looks like the following:  
  
?an=XXX&cn=XX&ln=XX  
  
No changes are needed. Your account is already up-to-date.

This path ends here.

<a id="step-1678819"></a>

## New Dynamic Loader script example

```javascript
< !-- Criteo Dynamic Loader File -->

<head>
<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=YOUR_PARTNER_ID" async="true"></script>
</head>

<!-- END Criteo Dynamic Loader -->
```

The new Dynamic Loader is almost the same as the Static Loader but requires a different placement on your website and a partner ID parameter.

Below is an example of the new Dynamic Loader Script, which should be included in the <head> of your site before the event and data collection script, and fired on all pages.

`< !-- Criteo Dynamic Loader File -->`  
  
`<head>`  
`<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=YOUR_PARTNER_ID" async="true"></script>`  
`</head>`  
  
`<!-- END Criteo Dynamic Loader -->`

Next: [Remove the old static loader](#step-1678817)

<a id="step-3387422"></a>

## Your website uses multiple domains

If your website uses multiple domains, one domain per country (eg. [www.domain.com](http://www.domain.com), [www.domain.co.uk](http://www.domain.co.uk), [www.domain.it](http://www.domain.it), [www.domain.es](http://www.domain.es), etc.) make the following changes:  
  
1) Update the script loader domain URL from [ststic.criteo.net](http://ststic.criteo.net) to [dynamic.criteo.com](http://dynamic.criteo.com).

2) Replace ld.js part for the URL, with ld.js?a=XXXX (where the a= value is the partner id given to you by Criteo. Each domain will have a different partnerid value, corresponding to the Country of the domain. If unsure, check with your Criteo representative).

Next: [Your website uses one single domain for multiple countries](#step-3387418)

<a id="step-1678817"></a>

## Remove the old static loader

After adding the Dynamic Loader, delete the static loader from the tags.

Next: [Dynamic Loader for multi-partners](#step-3387435)

<a id="step-3387418"></a>

## Your website uses one single domain for multiple countries

If your website uses one single domain for multiple countries  
(eg. www.domain.ext/us, www.domain.ext/uk www.domain.ext/it etc. OR us.domain.ext, uk.domain.ext, it.domain.ext, es.domain.ext etc.), make these changes:  
  
1\. Update the script loader domain URL from [static.criteo.net](http://static.criteo.net) to [dynamic.criteo.com](http://dynamic.criteo.com).

2\. Replace ld.js part for the URL, with ld.js?a=XXXX (where the a= value is the partnerid given to you by Criteo. Each domain will have a different partnerid value, corresponding to the Country of the domain. If unsure, check with your Criteo representative).

> **Tip:** Note: In this case, as your website makes use of a single domain for multiple Countries, you will want to make a note of which partner id value Criteo has given you for each Country / Region, so that you can insert it dynamically into the Dynamic Loader script, depending on the Country selected by users of your website. This is so that users' activity can be correctly tracked into the correct Criteo account.

3.  Alternatively, you may wish to set this up by making use of different include files loaded from within the HTML tag (a different one per country of your website), each one having a Dynamic Loader script with a different partnerid value assigned. Providing the Country-specific include file is applied to all pages for that Country, this will achieve a similar result.

Next: [Removing the old Static Loader Script](#step-3387419)

<a id="step-3387435"></a>

## Dynamic Loader for multi-partners

```javascript
<!-- Criteo Dynamic Loader File -->

<head>
<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=YOUR_PARTNER_ID_xxxxx&a=YOUR_PARTNER_ID_yyyyy" async="true"></script>
</head>

<!-- END Criteo Dynamic Loader File -->
```

The Dynamic Loader is compatible with multi-partner integrations.

For multi-partner integrations, an additional “a” parameter can be added. For instance:

`<!-- Criteo Dynamic Loader File -->`  
  
`<head>`  
`<script type="text/javascript" src="//dynamic.criteo.com/js/ld/ld.js?a=YOUR_PARTNER_ID_xxxxx&a=YOUR_PARTNER_ID_yyyyy" async="true"></script>`  
`</head>`  
  
`<!-- END Criteo Dynamic Loader File -->`

This path ends here.

<a id="step-3387419"></a>

## Removing the old Static Loader Script

After adding the Dynamic Loader, remember to delete any other versions of the old Static Loader Script, that may have still been present on pages of your website.

> **Tip:** Note: Keeping the Static Loader Script executing along with the Dynamic Loader script will not cause any problems, but we recommend doing some clean-ups and removing the old script to avoid confusion in future.

This path ends here.
