Summary

  1. The Reddit base pixel tracks visits, while additional events identify actions further along the purchase journey.

  2. The guide covers purchase and Add to Cart tracking alongside the base setup.

  3. Use the event data to understand which Reddit ad visits lead to shopping actions and sales.

 

Watch the video demonstration

If you’re advertising with Reddit ads (or are planning to), you’ll need to add the Reddit pixel to Shopify.

But just adding the base pixel won’t be enough. Tracking when someone adds an item to their cart or finishes a purchase is super important as well.

In this guide, I’ll show you how to install the Reddit pixel in Shopify.

Ready? Let’s get started.

1. Add your Reddit base code to Shopify

Head over to your Reddit ads conversion page (https://ads.reddit.com/conversions)

Log in if you haven’t yet, and click the Conversion Pixel button at the top left of the page.

A modal will appear with a block of code – this is your base code.

Copy the code. We’re going to paste it in the<head></head>tags of your store. You’ll find this within your theme.liquid file in Shopify. Here’s how:

  1. Head over to your store’s Shopify admin by selecting Online Store > Themes.
  2. For your current theme, click Actions and select Edit code.
  3. Under Layout, select theme.liquid.
  4. Ctrl+F and search for </head>
  5. Paste your base tag in the line before </head>

2. Track purchases generated by Reddit ads

Now for the important part – letting Reddit know when a purchase was made.

  1. From your Shopify admin, go to Settings > Checkout.
  2. Scroll down to the Order processing section to find the Additional scripts text box there.
  3. Paste the base tag code you got from part one in this box.
  4. Then paste the following code in the same box and save your settings.
    <script>
        rdt('track', 'Purchase')
    </script>

3. Track add to carts generated by Reddit ads

Finally, it can be important to know what ads generate Add to Carts as well.

This is the hard part – it takes a little searching. A basic understanding of HTML is helpful to have but not necessary.

  1. Let’s find your Add to Cart button’s ID first. We’ll use Chrome for this. Open up a product page on your shop and find the Add to Cart button. Right click on the button and click inspect from the popup menu.
  2. A screen with a bunch of code will appear – your button’s code will be highlighted. Look for the id property, it looks like id=”add-to-cart-button” but your text will be different. Write down the text within the quotation marks. In our example it’s add-to-cart-button.
  3. From your Shopify admin, go to Online Store > Themes.
  4. On your current theme, click Actions and select Edit code.
  5. Under Layout, select theme.liquid
  6. Ctrl+F or Command+F and search for </body>
  7. Paste the following code in the line before </body>. Then replace replace-this in the code with your button’s ID from step 2.
    {% if template contains 'product' %}
    <script>
    var atcButtonID = "replace-this";
    
    var atcButton = document.getElementById(atcButtonID);
    if(atcButton){
    	atcButton.addEventListener("click", function(event) {
                rdt('track', 'AddToCart')
    	});
    }
    </script>
    {% endif %}
  8. Save your theme and we should be good!

That’s it!

Your Reddit ads conversions are now tracked. You can see which ads are the most effective.

Is your Shopify store
fast enough?

Find out what’s slowing your storefront down and where to start improving it.

Preparing your demo

  1. Checking your store
  2. Opening your homepage, a collection and a product
  3. Extracting the styles your first screen needs
  4. Getting your demo ready

This usually takes 10 to 30 seconds.

FAQ

What does the Reddit base pixel track?

The guide uses the base code to establish tracking on the store. Separate events identify shopping actions such as purchases and additions to the cart.

Why is purchase tracking separate from the base code?

A visit alone does not indicate a sale. The guide adds a Purchase event so the advertising platform can distinguish completed orders from browsing.

Why does the Add to Cart example need a button ID?

The example attaches an event listener to a specific button. Its ID tells the code which element to watch for a click.

Can I use the placeholder button ID unchanged?

No. The guide instructs readers to replace the placeholder with the actual Add to Cart button ID from their theme. Otherwise, the example will not target the intended control.

What should I do if I am not comfortable editing theme code?

The article provides an alternative to its manual installation path. The essential requirement remains the same: configure the base tracking and the shopping events you need.