Meta Pixel

Last updated: February 22, 2025

Replo automatically integrates with your Meta Pixel configuration from your Shopify store - in most cases, there should be no action necessary to track Meta pixel events on Replo 📄 Pages, 📄 Product Templates, or 📄 Blog Posts.

Tracking custom Meta Pixel events in Replo pages

Custom Meta Pixel events can be tracked using the fbq javascript function in 📄 Custom HTML and Liquid components inside of Replo. See Meta's documentation on how to configure custom events, which notes that "You can call the fbq('track') function anywhere between your web page's opening and closing <body> tags, either when the page loads, or when a visitor completes an action, such as clicking a button."

It's important to use a 📄 Custom HTML and Liquid component and not something like the "Custom <head>" setting from 📄 Pages settings, because only 📄 Custom HTML and Liquid components will go inside the <body> tag.

Usually, the content of the Custom HTML component will look like this:

<script>
fbq('trackCustom', 'ShareDiscount', {promotion: 'share_discount_10%'});
</script>

You can also use a Custom Liquid component if you'd like to access liquid data like product:

<script>
fbq(
  'track',
  "ProductViewed",
  { productId: "{{ product.id }}", promotion: 'share_discount_10%' }
);
</script>

If you'd like to access the product liquid variable, make sure to place your Liquid component inside a 📄 Shopify Product Components component.

Last, you can also use a this concept to fire these custom events via the Run JS interaction. Just place the relevant JS code snippet inside the interaction's code editor.

fbq('trackCustom', 'ShareDiscount', {promotion: 'share_discount_10%'});

Troubleshooting

My Custom Event is not being tracked on my Replo pages

Make sure you've added the event tracking code inside a 📄 Custom HTML and Liquid component, not somewhere like in the Custom Page <head>.