Install the Reddit Pixel
Follow these steps to install the Reddit Pixel on your website, from Google Tag Manager (GTM), or from your Shopify store’s back end.
Follow these steps to install the Reddit Pixel on your website, from Google Tag Manager (GTM), or from your Shopify store’s back end.
The Reddit Pixel is a snippet of JavaScript code, but it’s a powerful little thing. Once you’ve placed it on your website, the pixel will allow you to track actions that visitors take after seeing or clicking your ad on Reddit.
There are a few ways to install the pixel code:
Some options require a little technical skill. If that’s not in your wheelhouse, you might want to ask the right technical support person on your team for assistance.
Tip: For faster implementation, use the setup wizard in Reddit Ads. With step-by-step instructions and dynamic code snippets, it's the easiest way to set up the Reddit Pixel. To use the wizard, Select Events Manager in the menu, and select Set Up Reddit Pixel. If you prefer static instructions, keep reading this article.
Before you begin, you should have:
You should also consider these:
<!DOCTYPE html>
<html lang="en">
<head>
PLACE PIXEL CODE HERE
</head>
By default, the Reddit Pixel base code will register a ‘PageVisit’ event when it is triggered. To track other events/actions that happen on your website, add event tracking on the page between <script></script> tags where specific events occur.
Replace 'EventName' in the code with any event you’d like to track:
<script> rdt('track', 'EventName'); </script>
Standard conversion events you can track:
Event name | Description | Code |
---|---|---|
PageVisit |
User lands on your landing page (default event) |
rdt('track', 'PageVisit'); |
ViewContent |
User lands on a specific webpage, like a product page |
rdt('track', 'ViewContent'); |
Search |
User performs a search query |
rdt('track', 'Search'); |
AddToCart |
User adds a product to the shopping cart |
rdt('track', 'AddToCart'); |
AddToWishlist |
User adds a product to a wishlist |
rdt('track', 'AddToWishlist'); |
Purchase |
User completes the purchase |
rdt('track', 'Purchase'); |
Lead |
User submits information expressing interest in the advertised product/offer |
rdt('track', 'Lead'); |
SignUp |
User completes a registration or sign up form |
rdt('track', 'SignUp'); |
Custom |
Additional user actions outside of the predefined standard events |
rdt('track', 'Custom', {customEventName:'YOUR CUSTOM EVENT HERE'}); |
Example for the ‘SignUp’ event:
<script> rdt('track', 'SignUp'); </script>
Features that will help squeeze the most out of your pixel integration:
Tracking inline action events
You can also use the pixel to track on-page actions (where the user clicks a button but stays on the same page). Example: a user clicks an Add to Cart button but stays on the same page. The pixel can tell you how many times this happens.
Where you see the ‘Add to Cart’ button in your code, add the following:
<script> const addToCartButton = document.getElementById('addToCart'); addToCartButton.addEventListener('click', () => rdt('track', 'AddToCart')); </script>
Your attribution window determines how long after viewing or clicking on your ad you count that user’s actions as a conversion. There are two attribution types—each with their own default window—and there are three options for configuring them: click-through, view-through, or click-through and view-through together (recommended).
If you want, you can edit your attribution window:
We offer a Limited Data Use (LDU) flag to help you meet your compliance needs, including opting out users if they have not consented to behavioral targeting. You must modify the pixel code to pass the LDU flag as instructed here.
Was this article helpful?