> For the complete documentation index, see [llms.txt](https://docs.didomi.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.didomi.io/fr/integrations/systeme-de-gestion-de-contenu-cms/shopify-beta/migrer-lintegration-shopify.md).

# Migrer l’intégration Shopify

Avant le lancement de l’intégration native Didomi/Shopify, Didomi fournissait deux scripts qui pouvaient être ajoutés manuellement à la boutique Shopify de votre organisation.&#x20;

<table data-header-hidden><thead><tr><th width="120"></th><th></th></tr></thead><tbody><tr><td>Script 1</td><td>Propagation du consentement à partir des catégories de consentement Shopify</td></tr><tr><td>Script 2</td><td>Gestion du paiement</td></tr></tbody></table>

Dans cet article, nous verrons comment supprimer ces anciens scripts afin que votre organisation puisse migrer vers l’intégration native Didomi/Shopify.

* [Supprimer le script 1](#remove-script-1)
* [Supprimer le script 2](#remove-script-2)
* [Configurer l’intégration native Didomi/Shopify](/fr/integrations/systeme-de-gestion-de-contenu-cms/shopify-beta.md)

{% hint style="info" %}
Les organisations qui ont précédemment implémenté les scripts 1 et 2 doivent supprimer ces scripts avant de poursuivre la configuration de l’intégration native Didomi/Shopify.
{% endhint %}

***

### Supprimer le script 1

Le script 1 permettait à votre organisation de propager les valeurs de consentement pour les fournisseurs configurés dans le CMP Didomi à partir des quatre [catégories de consentement Shopify](/fr/integrations/systeme-de-gestion-de-contenu-cms/shopify-beta.md#shopify-consent-categories): Analytics, Marketing, Preferences et Sale of Data. L’intégration native Didomi/Shopify prendra en charge cette propagation une fois implémentée, ce script doit donc être supprimé du code du thème de votre boutique Shopify.

Accédez à la vue administrateur de votre boutique Shopify et cliquez sur **Boutique en ligne** dans le panneau de gauche.

Cliquez sur les points de suspension alignés avec le thème actif de votre boutique en ligne et sélectionnez **Modifier le code** dans le menu déroulant.

<figure><img src="/files/4271d8073ec509ac35aea946dac1aff41e8968ba" alt="" width="563"><figcaption></figcaption></figure>

Dans l’éditeur de code du thème de la boutique Shopify, développez le menu **layout** et sélectionnez le fichier **theme.liquid** .

<figure><img src="/files/5234c122ecb993b01597f7b0c41adfc84a16cb5e" alt="" width="563"><figcaption></figcaption></figure>

Supprimez le script SDK Didomi de la balise `<head>` dans le fichier. Voici un exemple du script SDK Didomi.

<details>

<summary>Exemple de script SDK Didomi</summary>

{% code overflow="wrap" %}

```javascript
<script type="text/javascript">(function(){function i(e){if(!window.frames[e]){if(document.body&&document.body.firstChild){var t=document.body;var n=document.createElement("iframe");n.style.display="none";n.name=e;n.title=e;t.insertBefore(n,t.firstChild)}else{setTimeout(function(){i(e)},5)}}}function e(n,o,r,f,s){function e(e,t,n,i){if(typeof n!=="function"){return}if(!window[o]){window[o]=[]}var a=false;if(s){a=s(e,i,n)}if(!a){window[o].push({command:e,version:t,callback:n,parameter:i})}}e.stub=true;e.stubVersion=2;function t(i){if(!window[n]||window[n].stub!==true){return}if(!i.data){return}var a=typeof i.data==="string";var e;try{e=a?JSON.parse(i.data):i.data}catch(t){return}if(e[r]){var o=e[r];windown{var n={};n[f]={returnValue:e,success:t,callId:o.callId};if(i.source){i.source.postMessage(a?JSON.stringify(n):n,"*")}},o.parameter)}}if(typeof window[n]!=="function"){window[n]=e;if(window.addEventListener){window.addEventListener("message",t,false)}else{window.attachEvent("onmessage",t)}}}e("__tcfapi","__tcfapiBuffer","__tcfapiCall","__tcfapiReturn");i("__tcfapiLocator")})();</script><script type="text/javascript">(function(){(function(e,i,o){var n=document.createElement("link");n.rel="preconnect";n.as="script";var t=document.createElement("link");t.rel="dns-prefetch";t.as="script";var r=document.createElement("script");r.id="spcloader";r.type="text/javascript";r["async"]=true;r.charset="utf-8";window.didomiConfig=window.didomiConfig||{};window.didomiConfig.sdkPath=window.didomiConfig.sdkPath||o||"https://sdk.privacy-center.org/";const d=window.didomiConfig.sdkPath;var a=d+e+"/loader.js?target_type=notice&target="+i;if(window.didomiConfig&&window.didomiConfig.user){var c=window.didomiConfig.user;var s=c.country;var f=c.region;if(s){a=a+"&country="+s;if(f){a=a+"&region="+f}}}n.href=d;t.href=d;r.src=a;var m=document.getElementsByTagName("script")[0];m.parentNode.insertBefore(n,m);m.parentNode.insertBefore(t,m);m.parentNode.insertBefore(r,m)})("myAPIKey","NoticeID")})();</script>
```

{% endcode %}

</details>

Ensuite, repérez la ligne suivante dans le **theme.liquid** fichier et supprimez-la pour ne plus utiliser le script dans le thème de votre boutique Shopify :

{% code overflow="wrap" %}

```liquid
{% render 'didomi-shopify-integration' %}
```

{% endcode %}

Enregistrez les modifications apportées au fichier une fois terminé.

Enfin, développez le menu **snippets** et repérez **didomi-shopify-integration.liquid** .

<figure><img src="/files/0c3b9c36fa5f7e9808c38d379653ab28eacf3d5f" alt="" width="563"><figcaption></figcaption></figure>

Faites un clic droit sur le fichier et sélectionnez **Supprimer définitivement** dans le menu déroulant suivant.

<figure><img src="/files/c8887497b340e63f4bd8f52b02943274c9664cd2" alt="" width="563"><figcaption></figcaption></figure>

Confirmez la suppression du fichier didomi-shopify-integration.liquid dans la fenêtre modale suivante et cliquez sur **Supprimer**.

<figure><img src="/files/57e7b660b42fce1b98fb256518f01d81820b4497" alt="" width="375"><figcaption></figcaption></figure>

### Supprimer le script 2

Le script 2 permettait à votre organisation d’intégrer le CMP Didomi au processus de paiement Shopify à l’aide d’un pixel personnalisé dans la boutique Shopify.&#x20;

Afin de supprimer ce script, accédez à la vue administrateur de votre boutique Shopify et cliquez sur **Paramètres** dans le panneau de gauche.

<figure><img src="/files/b77acc8ec2ea8d2db07aed1db3cdc2260e843287" alt="" width="563"><figcaption></figcaption></figure>

Cliquez sur **Événements clients** dans le panneau de gauche de la page suivante.

<figure><img src="/files/7ee1bb26e9795438dc71cfd724e14441d529ce76" alt="" width="563"><figcaption></figcaption></figure>

Sélectionnez dans la liste le pixel où le script Didomi est ajouté.

<figure><img src="/files/f3584660049593b8a12f97d7ab599fe6639f1e41" alt="" width="563"><figcaption></figcaption></figure>

Repérez le script dans l’éditeur de code du pixel et supprimez-le du code. Voici un exemple.

<details>

<summary>Exemple de script 2</summary>

{% code overflow="wrap" %}

```javascript
window.dataLayer = window.dataLayer || [];
function gtag() {
  dataLayer.push(arguments);
}

function areVendorsEnabledInToken() {
  const cookieName = "didomi_token";
  const vendorsToCheck = ["google", "c:googleana-4TXnJigR"];

  // Get the value of a specific cookie
  const getCookieValue = (cookieName) => {
    const cookies = document.cookie.split("; ");
    const cookie = cookies.find((c) => c.startsWith(`${cookieName}=`));
    return cookie ? decodeURIComponent(cookie.split("=")[1]) : null;
  };

  // Decode Base64 and parse JSON
  const decodeBase64Cookie = (base64String) => {
    const decodedString = atob(base64String);
    return JSON.parse(decodedString);
  };

  // Check which vendors are enabled
  const checkVendors = (cookieData, vendorsToCheck) => {
    const result = {};
    vendorsToCheck.forEach((vendor) => {
      result[vendor] =
        cookieData &&
        cookieData.vendors &&
        cookieData.vendors.enabled &&
        cookieData.vendors.enabled.includes(vendor);
    });
    return result;
  };

  // Retrieve Didomi token from cookies or localStorage
  const didomiToken =
    getCookieValue(cookieName) || localStorage.getItem(cookieName);

  if (!didomiToken) {
    console.error(`Cookie ${cookieName} not found.`);
    return null;
  }

  return checkVendors(decodeBase64Cookie(didomiToken), vendorsToCheck);
}

if (
  window.location.href.includes("/checkout/") ||
  window.location.href.includes("/checkouts/")
) {
  gtag("consent", "default", {
    ad_storage: "denied",
    analytics_storage: "denied",
    functionality_storage: "denied",
    personalization_storage: "denied",
    security_storage: "granted",
    ad_user_data: "denied",
    ad_personalization: "denied",
    wait_for_update: 500,
  });

  analytics.subscribe("page_viewed", () => {
    const { google, "c:googleana-4TXnJigR": googleAnalytics } =
      areVendorsEnabledInToken();
    gtag("consent", "update", {
      ad_storage: google ? "granted" : "denied",
      analytics_storage: googleAnalytics ? "granted" : "denied",
      functionality_storage: google ? "granted" : "denied",
      personalization_storage: google ? "granted" : "denied",
      security_storage: "granted",
      ad_user_data: google ? "granted" : "denied",
      ad_personalization: google ? "granted" : "denied",
      wait_for_update: 500,
    });
  });
}
```

{% endcode %}

</details>

Cliquez sur **Enregistrer** une fois terminé.

<figure><img src="/files/0c0b8933050852f1f7f033c2280529924aa01914" alt="" width="563"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.didomi.io/fr/integrations/systeme-de-gestion-de-contenu-cms/shopify-beta/migrer-lintegration-shopify.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
