# Shopify

L'application Commanders Act, disponible dans le [Shopify App Store](https://apps.shopify.com/commanders-act), aide les commerçants à rationaliser leurs flux de travail en connectant les événements Shopify avec des partenaires. Que vous suiviez les interactions des clients ou optimisiez les performances publicitaires, notre application simplifie le processus. En interceptant les événements Standard et Custom de Shopify, l'application Commanders Act s'intègre parfaitement à votre stack existant tout en tirant parti de la Shopify Customer Privacy API. Cela signifie moins de configuration manuelle et une collecte de données plus sécurisée.

## Principales fonctionnalités

* Connecter [Shopify standard](https://shopify.dev/docs/api/web-pixels-api/standard-events) et les événements custom avec vos partenaires.
* Activer des capacités de suivi server-side fiables via [destinations](https://doc.commandersact.com/getting-started/concepts#destination).
* Garantir la confidentialité des utilisateurs en prenant en charge [Shopify Customer Privacy API](https://shopify.dev/docs/api/customer-privacy).
* Conserver les données d'événements Shopify d'origine.
* Configuration conviviale.
* Inclure une fonctionnalité de débogage pour le dépannage.

## Configuration de la source

1. Connectez-vous à votre [Commanders Act account](https://app.commandersact.com/).
2. Dans le menu de gauche, cliquez sur `(1)` `Sources` pour développer la section :\
   \
   ![](https://3282103337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-02b8a1d8d84be72d5bd313ed519fbe7cc1c211e0%2Fshopify_1.png?alt=media)\\
3. Cliquez `(2)` `Source catalog` :\
   \
   ![](https://3282103337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-70e8be7c818db6ac22e97908b91741c1b3f91487%2Fshopify_2.png?alt=media)\\
4. Dans la zone de recherche, tapez `(3)` "Shopify" et cliquez sur le `(4)` `Shopify web` à droite :\
   \
   ![](https://3282103337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-2759977946f8756aed70b6d9e275c7870125f28c%2Fshopify_3.png?alt=media)\\
5. Cliquez sur `(5)` `Configure` :\
   \
   ![](https://3282103337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-dfcf097df72d51dadae0a19416af8eee678960ba%2Fshopify_6.png?alt=media)\\
6. Saisissez `(6)` un nom pour votre source, sélectionnez `(7)` un environnement et cliquez sur `(8)` `Next` :\
   \
   ![](https://3282103337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-a9defb81cb342a16dc0e636bac3a72991815fb64%2Fshopify_7.png?alt=media)\\
7. Si vous avez déjà des destinations en place, vous pouvez les connecter à votre source Shopify en cochant la case `(9)` en haut ou en `(10)` sélectionnant celle que vous souhaitez lier :\
   \
   ![](https://3282103337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-91ae4224831b09e7800f475f35ad7f28fbbf8dfb%2Fshopify_9.png?alt=media)\\
8. Faites défiler vers le bas et cliquez sur `Save`.
9. Notez votre `(11)` `Site/Account Id` et `(12)` `Source Key` :\
   \
   ![](https://3282103337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-b149e600f3d140f6a3c49e83051de1ddcf64f3de%2Fshopify_10.png?alt=media)\
   \
   Vous allez utiliser ces deux valeurs dans la section suivante : [Configuration de l'application](#app-setup).

## Configuration de l'application

1. Ouvrez notre [application URL in Shopify App Store](https://apps.shopify.com/commanders-act).
2. Installez l'application en cliquant sur `(1)` `Install` bouton :\
   \
   ![](https://3282103337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-4828ef9ad6c54cf9de034a626c4d609e51e9f62e%2Fshopify_4.png?alt=media)\\
3. Configurez l'application en fournissant à la fois le `(2)` `Site/Account Id` et `(3)` `Source Key` depuis la source que vous avez créée dans la section [Configuration de la source](#source-setup) (Voir l'étape 9 ci-dessus.) puis activez `(4)` le commutateur en vert pour activer la configuration de votre application :\
   \
   ![](https://3282103337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-eb87dce3ab0cab604f9935e8acec0a307ecebbe4%2Fshopify_5.png?alt=media)\\
4. Cliquez `Save` pour terminer la configuration et activer l'application. Voir la section suivante [Valider votre configuration](#validate-your-setup) pour vous assurer que le suivi est activé.

{% hint style="info" %}
À tout moment, vous pouvez désactiver l'application en mettant le `(4)` commutateur sur off/rouge et en cliquant sur `Save` .
{% endhint %}

## Valider votre configuration

1. Connectez-vous à votre [Commanders Act account](https://app.commandersact.com/).
2. Dans le menu de gauche, cliquez sur (1) `Sources` pour développer la section :\
   \
   ![](https://3282103337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-02b8a1d8d84be72d5bd313ed519fbe7cc1c211e0%2Fshopify_1.png?alt=media)\\
3. Cliquez sur (2) `Overview` :\
   \
   ![](https://3282103337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-d946064283ee22bb755ac6e6cb2622b13d9cfb16%2Fshopify_11.png?alt=media)\\
4. Dans la zone de recherche, tapez (3) le nom de votre source et (4) cliquez dessus :\
   \
   ![](https://3282103337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-c8f6514b91d8031a31b615cdcd5cc1e95cfac1f1%2Fshopify_12.png?alt=media)\
   \
   Vous pouvez déjà avoir le (5) `Trend` montrant un pic, ce qui signifie que des événements arrivent.
5. Cliquez sur (6) `Event Inspector` :\
   \
   ![](https://3282103337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk6XpTQ2LaRLcr2tA-d%2Fuploads%2Fgit-blob-3346a24347b0756c0e8496d433cf2fbbdb1672fb%2Fshopify_13.png?alt=media)\\
6. Vérifiez les logs/entrées rapportés.\\

## Référence rapide

{% hint style="info" %}
Le tableau suivant montre la correspondance entre les événements Commanders Act et Shopify.\
Les événements custom Shopify sont également transmis à Commanders Act avec le même nom d'événement Shopify d'origine.
{% endhint %}

| Shopify Events                     | Commanders Act Events         |
| ---------------------------------- | ----------------------------- |
| `cart_viewed`                      | `view_cart`                   |
| `checkout_completed`               | `purchase`                    |
| `checkout_shipping_info_submitted` | `add_shipping_info`           |
| `checkout_started`                 | `begin_checkout`              |
| `collection_viewed`                | `view_item_list`              |
| `page_viewed`                      | `page_view`                   |
| `payment_info_submitted`           | `add_payment_info`            |
| `product_added_to_cart`            | `add_to_cart`                 |
| `product_removed_from_cart`        | `remove_from_cart`            |
| `product_viewed`                   | `view_item`                   |
| `search_submitted`                 | `search`                      |
| `[Custom Shopify event name]`      | `[Custom Shopify event name]` |

## Mappages de champs

{% hint style="info" %}
Toutes les propriétés Shopify sont récupérées depuis la `event` propriété.\
Les données d'événement Shopify d'origine, avec toutes leurs propriétés, sont stockées dans la propriété Commanders Act `partners.shopify.event` .
{% endhint %}

<table data-full-width="true"><thead><tr><th width="682.66650390625">Shopify Properties</th><th>Commanders Act Properties</th></tr></thead><tbody><tr><td><code>analytics.subscribe(...)</code></td><td><code>event_name</code> <strong>[1]</strong></td></tr><tr><td><p><code>data.checkout.order.id</code></p><p><code>data.element.id</code></p></td><td><code>id</code></td></tr><tr><td><p><code>data.checkout.subtotalPrice.amount</code></p><p><code>data.cartLine.cost.totalAmount.amount</code></p><p><code>data.cart.cost.totalAmount.amount</code></p></td><td><code>value</code></td></tr><tr><td><code>data.checkout.totalPrice.amount</code></td><td><code>revenue</code></td></tr><tr><td><code>data.checkout.shippingLine.price.amount</code></td><td><code>shipping_amount</code></td></tr><tr><td><code>data.checkout.totalTax.amount</code></td><td><code>tax_amount</code></td></tr><tr><td><p><code>data.checkout.currencyCode</code></p><p><code>data.cartLine.cost.totalAmount.currencyCode</code></p><p><code>data.cart.cost.totalAmount.currencyCode</code></p></td><td><code>currency</code></td></tr><tr><td><code>context.document.location.href</code></td><td><code>url</code></td></tr><tr><td><code>context.document.title</code></td><td><code>page_title</code></td></tr><tr><td><code>context.document.location.href</code></td><td><code>context.page.url</code></td></tr><tr><td><code>context.navigator.language</code></td><td><code>context.page.lang</code></td></tr><tr><td><code>context.navigator.userAgent</code></td><td><code>context.device.user_agent</code></td></tr><tr><td><code>data.searchResult.query</code></td><td><code>search_term</code></td></tr><tr><td><code>data.checkout.transactions.0.paymentMethod.type</code></td><td><code>payment_method</code> <strong>[2]</strong></td></tr><tr><td><code>data.checkout.discountApplications.X.title</code></td><td><code>coupon</code></td></tr><tr><td><code>data.checkout.order.customer.id</code></td><td><code>user.id</code></td></tr><tr><td><code>data.checkout.order.customer.isFirstOrder</code></td><td><code>user.status</code> <strong>[3]</strong></td></tr><tr><td><p><code>data.checkout.shippingAddress.firstName</code></p><p><code>data.checkout.billingAddress.firstName</code></p></td><td><code>user.firstname</code></td></tr><tr><td><p><code>data.checkout.shippingAddress.lastName</code></p><p><code>data.checkout.billingAddress.lastName</code></p></td><td><code>user.lastname</code></td></tr><tr><td><code>data.checkout.email</code></td><td><code>user.email</code></td></tr><tr><td><p><code>data.checkout.phone</code></p><p><code>data.checkout.shippingAddress.phone</code></p></td><td><code>user.phone</code></td></tr><tr><td><p><code>data.checkout.shippingAddress.address1 + data.checkout.shippingAddress.address2</code></p><p><code>data.checkout.billingAddress.address1 + data.checkout.billingAddress.address2</code></p></td><td><code>user.street</code></td></tr><tr><td><p><code>data.checkout.shippingAddress.city</code></p><p><code>data.checkout.billingAddress.city</code></p></td><td><code>user.city</code></td></tr><tr><td><p><code>data.checkout.shippingAddress.countryCode</code></p><p><code>data.checkout.billingAddress.countryCode</code></p></td><td><code>user.country</code></td></tr><tr><td><p><code>data.checkout.shippingAddress.province</code></p><p><code>data.checkout.billingAddress.province</code></p></td><td><code>user.state</code></td></tr><tr><td><p><code>data.checkout.shippingAddress.zip</code></p><p><code>data.checkout.billingAddress.zip</code></p></td><td><code>user.zipcode</code></td></tr><tr><td><code>data.collection.title</code></td><td><code>item_list_name</code></td></tr><tr><td><p><code>data.checkout.lineItems.X.variant.id</code></p><p><code>data.checkout.lineItems.X.merchandise.id</code></p><p><code>data.checkout.lineItems.X.id</code></p><p><code>data.cart.lines.X.variant.id</code></p><p><code>data.cart.lines.X.merchandise.id</code></p><p><code>data.cart.lines.X.id</code></p><p><code>data.collection.productVariants.X.variant.id</code></p><p><code>data.collection.productVariants.X.merchandise.id</code></p><p><code>data.collection.productVariants.X.id</code></p><p><code>data.searchResult.productVariants.X.variant.id</code></p><p><code>data.searchResult.productVariants.X.merchandise.id</code></p><p><code>data.searchResult.productVariants.X.id</code></p><p><code>data.productVariant.product.id</code></p><p><code>data.cartLine.merchandise.product.id</code></p></td><td><code>items.X.id</code> <strong>[4]</strong></td></tr><tr><td><p><code>data.checkout.lineItems.X.variant.product.title</code></p><p><code>data.checkout.lineItems.X.merchandise.product.title</code></p><p><code>data.checkout.lineItems.X.product.title</code></p><p><code>data.cart.lines.X.variant.product.title</code></p><p><code>data.cart.lines.X.merchandise.product.title</code></p><p><code>data.cart.lines.X.product.title</code></p><p><code>data.collection.productVariants.X.variant.product.title</code></p><p><code>data.collection.productVariants.X.merchandise.product.title</code></p><p><code>data.collection.productVariants.X.product.title</code></p><p><code>data.searchResult.productVariants.X.variant.product.title</code></p><p><code>data.searchResult.productVariants.X.merchandise.product.title</code></p><p><code>data.searchResult.productVariants.X.product.title</code><br><code>data.productVariant.product.title</code></p><p><code>data.cartLine.merchandise.product.title</code></p></td><td><code>items.X.product.name</code> <strong>[4]</strong></td></tr><tr><td><p><code>data.checkout.lineItems.X.variant.price.amount</code></p><p><code>data.checkout.lineItems.X.merchandise.price.amount</code></p><p><code>data.checkout.lineItems.X.price.amount</code></p><p><code>data.cart.lines.X.variant.price.amount</code></p><p><code>data.cart.lines.X.merchandise.price.amount</code></p><p><code>data.cart.lines.X.price.amount</code></p><p><code>data.collection.productVariants.X.variant.price.amount</code></p><p><code>data.collection.productVariants.X.merchandise.price.amount</code></p><p><code>data.collection.productVariants.X.price.amount</code></p><p><code>data.searchResult.productVariants.X.variant.price.amount</code></p><p><code>data.searchResult.productVariants.X.merchandise.price.amount</code></p><p><code>data.searchResult.productVariants.X.price.amount</code><br><code>data.productVariant.price.amount</code></p><p><code>data.cartLine.merchandise.price.amount</code></p></td><td><code>items.X.product.price</code> <strong>[4]</strong></td></tr><tr><td><p><code>data.checkout.lineItems.X.quantity</code></p><p><code>data.cart.lines.X.quantity</code></p><p><code>data.collection.productVariants.X.quantity</code></p><p><code>data.searchResult.productVariants.X.quantity</code><br><code>data.cartLine.quantity</code></p></td><td><code>items.X.quantity</code> <strong>[4]</strong></td></tr><tr><td><p><code>data.checkout.lineItems.X.variant.product.vendor</code></p><p><code>data.checkout.lineItems.X.merchandise.product.vendor</code></p><p><code>data.checkout.lineItems.X.product.vendor</code></p><p><code>data.cart.lines.X.variant.product.vendor</code></p><p><code>data.cart.lines.X.merchandise.product.vendor</code></p><p><code>data.cart.lines.X.product.vendor</code></p><p><code>data.collection.productVariants.X.variant.product.vendor</code></p><p><code>data.collection.productVariants.X.merchandise.product.vendor</code></p><p><code>data.collection.productVariants.X.product.vendor</code></p><p><code>data.searchResult.productVariants.X.variant.product.vendor</code></p><p><code>data.searchResult.productVariants.X.merchandise.product.vendor</code></p><p><code>data.searchResult.productVariants.X.product.vendor</code></p><p><code>data.productVariant.product.vendor</code></p><p><code>data.cartLine.merchandise.product.vendor</code></p></td><td><code>items.X.product.brand</code> <strong>[4]</strong></td></tr><tr><td><p><code>data.checkout.lineItems.X.discountAllocations.Y.amount.amount</code></p><p><code>data.cart.lines.X.discountAllocations.Y.amount.amount</code></p><p><code>data.collection.productVariants.X.discountAllocations.Y.amount.amount</code></p><p><code>data.searchResult.productVariants.X.discountAllocations.Y.amount.amount</code></p></td><td><code>items.X.discount</code> <strong>[4]</strong></td></tr><tr><td><p><code>data.checkout.lineItems.X.discountAllocations.Y.discountApplication.title</code></p><p><code>data.cart.lines.X.discountAllocations.Y.discountApplication.title</code></p><p><code>data.collection.productVariants.X.discountAllocations.Y.discountApplication.title</code></p><p><code>data.searchResult.productVariants.X.discountAllocations.Y.discountApplication.title</code></p></td><td><code>items.X.coupon</code> <strong>[4]</strong></td></tr><tr><td><code>analyticsProcessingAllowed</code></td><td><code>analyticsProcessingAllowed</code> <strong>[5]</strong></td></tr><tr><td><code>marketingAllowed</code></td><td><code>marketingAllowed</code> <strong>[5]</strong></td></tr><tr><td><code>preferencesProcessingAllowed</code></td><td><code>preferencesProcessingAllowed</code> <strong>[5]</strong></td></tr><tr><td><code>saleOfDataAllowed</code></td><td><code>saleOfDataAllowed</code> <strong>[5]</strong></td></tr><tr><td><code>[Original Shopify event data]</code></td><td><code>partners.shopify.event</code></td></tr></tbody></table>

{% hint style="info" %}

> **\[1]** Consultez la Référence rapide pour plus de détails.  \
> \&#xNAN;**\[2]** Voir les valeurs prises en charge [ici](https://doc.commandersact.com/developers/tracking-and-integrations/tracking/events-reference#payment-methods).  \
> \&#xNAN;**\[3]** Défini sur "New".  \
> \&#xNAN;**\[4]** Valeur basée sur la liste de priorité dans la colonne de gauche.  \
> \&#xNAN;**\[5]** Propriété définie à partir du chemin de base `partners.shopify.userConsent`.
> {% endhint %}
