Thème

Bonjour, j’ai un problème avec ma boutique Shopify qui utilise le thème Dwell. Lorsque les clients cliquent sur mes publicités Meta sur Android, la page de destination se charge correctement, mais la navigation vers toute autre page provoque un chargement infini dans le navigateur intégré de Facebook. Le problème ne se produit pas dans Chrome ou Safari.

Nous avons identifié qu’il existe un script personnalisé dans layout/theme.liquid qui suit les événements AddToCart pour Meta Pixel. Le supprimer résout le problème de navigation mais interrompt le suivi des publicités. La solution consiste à remplacer ce script personnalisé par le suivi natif AddToCart de l’application Facebook et Instagram.

Le script à supprimer est le suivant :

balise script avec document.addEventListener DOMContentLoaded qui écoute les clics sur les boutons d’ajout au panier et déclenche fbq track AddToCart.

Quelqu’un peut-il aider avec cela ou confirmer la meilleure façon de configurer le suivi natif AddToCart via l’application Facebook et Instagram ?

Bonjour, d’après les informations que vous nous avez fournies, il semblerait que le script Meta Pixel personnalisé soit à l’origine d’un conflit avec le navigateur intégré à l’application Facebook, plutôt qu’avec le thème Dwell lui-même.

La meilleure solution serait de supprimer l’événement manuel `fbq.track(“AddToCart”)` et de laisser le canal de vente officiel Facebook & Instagram gérer automatiquement le suivi. L’intégration native de Shopify est généralement plus fiable, car elle utilise la configuration d’événements appropriée et évite le déclenchement en double du pixel.

Après avoir supprimé le script personnalisé, assurez-vous que :

* L’application Facebook et Instagram est correctement connectée dans Shopify

* Votre Meta Pixel est sélectionné dans les paramètres de l’application

* Les événements de test s’affichent correctement dans Meta Events Manager

Vous pouvez également utiliser l’outil « Test Events » de Meta pour vérifier que l’événement « AddToCart » se déclenche avant de relancer vos publicités.

Hi @soleina

Yes, replacing the custom fbq('track', 'AddToCart') script with the native tracking provided by the Shopify Facebook & Instagram app is generally the recommended approach.

The app is designed to send standard events, including AddToCart, without requiring custom JavaScript. Running both a custom fbq script and the native integration can lead to duplicate events or unexpected behavior, especially in embedded browsers like Facebook’s in-app browser.

Before removing the custom script, I’d recommend:

  • Confirming that the Facebook & Instagram app is properly connected to your Meta Pixel.

  • Verifying that Data Sharing is set to Enhanced or Maximum.

  • Testing the AddToCart event in Meta Events Manager using the Test Events tool to ensure the native event is firing correctly.

  • After confirming the native event works, remove the custom script from layout/theme.liquid and test navigation again in the Facebook in-app browser.

If the issue disappears after removing the custom script, it’s a strong indication that the custom implementation was interfering with navigation. Using the native integration is usually more reliable and easier to maintain.

Best regards,
Devcoder :laptop:

Hey @soleina ,

If you’re already using the Facebook & Instagram app, I’d avoid maintaining a custom AddToCart tracking script unless it’s absolutely necessary. The native integration is generally easier to maintain and reduces the risk of conflicts like this. If removing the custom script resolves the navigation issue, switching to the native tracking approach seems like the right direction.

Thank You !

It sounds like you’ve already isolated the root cause. If removing the custom fbq('track', 'AddToCart') script fixes the infinite loading issue in Meta’s in-app browser, it’s generally a good idea to avoid custom pixel code unless there’s a specific requirement.

The Facebook & Instagram sales channel already supports native Meta Pixel and Conversions API tracking, including the AddToCart event, when it’s configured correctly. Using the native integration is usually more reliable and reduces the risk of conflicts with themes or JavaScript in embedded browsers.

Before removing the custom script permanently, I’d recommend:

  • Verifying that the Meta Pixel is connected through the Facebook & Instagram app.
  • Testing the AddToCart event with Meta Events Manager using the Test Events tool.
  • Confirming both browser and Conversions API events are being received without duplicates.

If the native event fires correctly, there’s typically no need to keep a custom fbq listener in theme.liquid, which should also help avoid compatibility issues with Meta’s in-app browser on Andr