This guide walks you through setting up Reddit Pixel and the Reddit Conversions API (CAPI) using Google Tag Manager (GTM) alongside a Seers-provisioned server-side container. The setup uses a parallel tracking approach, the most reliable method for capturing accurate, resilient conversion data for your Reddit advertising campaigns.
Prerequisites
Before getting started, confirm the following are in place:
- Reddit Ads Manager: Access to your Reddit Ads Manager account, including the Events Manager for your specific Pixel.
- Pixel ID and Access Token: Both are required for the Reddit Conversions API and can be retrieved from your Reddit Events Manager.
- Web Google Tag Manager (GTM): A web GTM container already deployed on your website and configured to send GA4 events to your server-side GTM instance. Refer to Google's documentation on sharing GTM container access.
- Server-Side GTM Container (Seers): A server-side GTM container provisioned by Seers, accessible via a first-party endpoint, and set up to process GA4 events. Visit the Seers Get Started page for setup instructions.
Why Use Server-Side Tagging for Reddit?
Greater Data Accuracy
Routing data through your server bypasses ad blockers and browser privacy restrictions such as Safari's ITP or Firefox's ETP, resulting in more complete and reliable conversion data reaching Reddit.
Stronger Data Control
You decide exactly what information is shared with Reddit. This allows you to enrich, filter, or anonymise data to comply with regulations such as GDPR and CCPA. Moving tracking server-side also reduces the JavaScript load in the browser, improving page speed, Core Web Vitals, and potentially your SEO performance.
Better Attribution
First-party cookies set from your own domain are more durable, and server-side event delivery is more resilient to browser-level restrictions. Together, these provide stronger and more consistent attribution for your Reddit campaigns.
Implementation Overview
This setup uses a parallel tracking model. Events are sent simultaneously from two sources: the user's browser via Reddit Pixel, and your server via the Reddit Conversions API. Reddit uses a unique Conversion ID to deduplicate these signals, ensuring each user action is counted only once, regardless of which source reported it first.
Step 1: Parallel Tracking Implementation
Part A: Web GTM Configuration (Client-Side)
The goal of this step is to configure your web GTM container to forward data to your Seers server-side container, while also firing the standard Reddit Pixel for browser-level tracking.
Create a Unique Event ID Variable
Every event must carry a unique ID that is identical across both the browser and server events for the same user action. To generate this, you will create a custom template in your web GTM container.
- In your web GTM container, go to Templates and click New.
- Name the template Unique Event ID.
- Paste the following code into the Code section:
const copyFromDataLayer = require('copyFromDataLayer');
const setInWindow = require('setInWindow');
const copyFromWindow = require('copyFromWindow');
const getTimestampMillis = require('getTimestampMillis');
const generateRandom = require('generateRandom');
return getBrowserId() + '_' + getPageLoadId() + getGtmUniqueEventId();
function getGtmUniqueEventId() {
let gtmId = copyFromDataLayer('gtm.uniqueEventId') || 0;
return gtmId >= 0 ? gtmId : '00';
}
function getBrowserId() {
let gtmBrowserId = copyFromWindow('gtmBrowserId');
if (!gtmBrowserId) {
gtmBrowserId = getTimestampMillis() + generateRandom(100000, 999999);
setInWindow('gtmBrowserId', gtmBrowserId, false);
}
return gtmBrowserId;
}
function getPageLoadId() {
let eventId = copyFromWindow('gtmPageLoadId');
if (!eventId) {
eventId = getTimestampMillis() + generateRandom(100000, 999999);
setInWindow('gtmPageLoadId', eventId, false);
}
return eventId;
}
|
- In the Permissions section, under Reads data layer > Specific, add the following variable: gtm.uniqueEventId.
- Under Accesses global variables, add the following two keys with Read and Write permissions: gtmBrowserId and gtmPageLoadId.
- Click Save.
- Go to Variables and click New. Create a variable named CJS - Unique Event ID with the variable type set to Unique Event ID (the template you just created).
Add the Event ID to Your GA4 Event Tags
On each GA4 event tag in your web container, add a parameter named event_id and set its value to the {{CJS - Unique Event ID}} variable.
Set Up the Reddit Pixel Tag
- In your web GTM container, go to Tags and click New.
- Click Tag Configuration and search for the Reddit Pixel tag template in the Community Template Gallery.
- Enter your Reddit Pixel ID. It is best practice to store this in a Constant variable.
- For the Page Visit event, and any other standard or custom events, insert the {{CJS - Unique Event ID}} variable in the Conversion ID field.
- To include product data, choose one of the following options based on your data layer:
- Standard GA4 purchase data layer: Check the box labelled Automatically collect and process Google Analytics ecommerce data.
- Non-standard data layer: Check JSON Payload and write a custom JavaScript variable as described in Part B below.
- Set the trigger to All Pages for the base Page Visit tag. For other events, such as Add To Cart or Purchase, apply the appropriate event-specific triggers.
| Important: The triggers used for your Reddit Pixel tags must match exactly the triggers used for your corresponding Google Analytics tags. This ensures the same Event ID is shared between the browser and server events. |
| Note on Hashing: Reddit Pixel hashes the Conversion ID using SHA256 (hex). The Reddit GTM Server Tag does not hash the ID, so the outgoing server request will appear different from the browser Pixel request. Reddit's server endpoint will automatically hash an unhashed Conversion ID if needed, but it can also process pre-hashed values. You may choose whether to hash the ID in server-side GTM or leave it to Reddit. |
Part B: Server-Side GTM Configuration
Now configure the server container to receive the incoming data and forward it to Reddit's Conversions API.
Create a Product Data Variable
The Reddit template cannot process GA4 product data directly; it needs to be transformed into the expected format using item_name, item_id, and item_categories.
- In your server-side GTM container, go to Variables and click New.
- Select Event Data Variable and set the key path to items.
- Name this variable Event Data - items.
- Go to Templates and click New Variable Template.
- Name the template Reddit item. Under Fields, add a text field named itemArray with the display name item.
- Under Code, paste the following:
// Enter your template code here.
const JSON = require('JSON');
var item_array = data.itemArray;
var reddit_item = [];
if (typeof(item_array) !== "undefined") {
for (var i = 0; i < item_array.length; i++) {
reddit_item[i] = {};
reddit_item[i].id = item_array[i].item_id;
// Start with the first category
let categories = [item_array[i].item_category];
// Check for and add additional categories if they exist
if (item_array[i].item_category2) {
categories.push(item_array[i].item_category2);
}
if (item_array[i].item_category3) {
categories.push(item_array[i].item_category3);
}
if (item_array[i].item_category4) {
categories.push(item_array[i].item_category4);
}
if (item_array[i].item_category5) {
categories.push(item_array[i].item_category5);
}
// Join the categories with " > "
reddit_item[i].category = categories.join(" > ");
reddit_item[i].name = item_array[i].item_name;
}
// Variables must return a value.
return JSON.stringify(reddit_item);
}
|
- Click Save.
- Go to Variables and click New. Select Reddit item as the variable type and set the Item field to the Event Data - items variable you created. Name this variable Reddit item.
Set Up the Reddit Conversions API Tag
- In your server-side GTM container, go to Tags and click New.
- Click Tag Configuration and search for the official Reddit Conversions API template.
- Enter the same Pixel ID used in your web container.
- Generate an Access Token in Reddit Events Manager under Conversions API. Store the token securely as a variable in your server-side GTM container and provide it in the tag's Access Token field.
- For Event Name, select the appropriate event from the template's list (e.g., Purchase, Add To Cart).
- For Conversion ID, map the event_id value from the incoming GA4 data; this is essential for deduplication.
Configure Advanced Matching (Recommended)
To improve Event Match Quality, configure the tag to send hashed user parameters. These should be sourced from your GA4 data layer or other available data:
- SHA256 Hashed Email (hex)
- SHA256 Hashed Phone
- SHA256 Hashed External ID
Set Product Information
In the tag configuration, check JSON Payload and set the Reddit item variable as the JSON Payload source. This passes the transformed product data to Reddit's API.
Configure the Trigger
- Set the trigger to fire on all GA4 client events.
- Ensure consent is validated at the trigger level, following Seers' consent guidelines.
- Consider allowlisting only the specific events you want to forward to Reddit to reduce noise and limit unnecessary data sharing with third-party vendors.
- Confirm that the same Conversion ID (event_id) is passed from both the web Pixel tag and the server-side CAPI tag.
| Note: After parallel tracking is live, it may take several hours before data from both the web Pixel and the Conversions API appears in Reddit's reporting interface. Server-side events will typically show a higher volume. Review each event individually and check for any unexpected discrepancies. |
A deduplication rate of around 50% is expected and indicates the setup is working correctly.
Step 2: Quality Assurance
Testing is an essential part of this setup. Use GTM Preview mode alongside Reddit's Event Testing view to validate your implementation before going live.
Part A: Validation and Debugging
- Enable Preview mode in both your web GTM and server-side GTM containers.
-
In Reddit Events Manager, select your Pixel and open the Event Testing section.
- Copy the test ID that begins with "t2_" and add it as the test_id parameter in the Reddit template:
- In your server-side GTM container, go to Templates and open the Reddit Conversions API template.
- Click on Code and replace the Test_mode variable with test_id.
-
Click Save and accept the prompt confirming you will no longer receive automatic template updates. Remember to reset the template after testing to re-enable updates.
- Open your website from the web GTM Preview tab. Also, open the server-side GTM Preview tab.
-
Copy the website URL containing the gtm_debug parameter and paste it into the field shown in the Event Testing section, then click Open.
- Navigate around your site and trigger the events you have configured.
- In the web GTM Preview, confirm that your Reddit Pixel tags are firing. Click on a tag and check the Conversion ID being sent.
- In the server-side GTM Preview, verify that incoming requests from your GA4 client are visible. Click on the Reddit Conversions API tag that fired and inspect the Conversion ID in the outgoing request; it must match the Conversion ID sent from the web GTM tag. Keep in mind that Reddit Pixel hashes the Conversion ID with SHA256 (hex), so the values may appear different if you are inspecting browser network requests directly.
- In the Reddit Events Manager Event Testing section, confirm that events are arriving from both the browser Pixel and the server, and that both share the same Conversion ID. Unhashed Conversion IDs sent from the server are hashed by Reddit before they are displayed.
Part B: Common Challenges and Solutions
Challenge: Events Are Not Being Deduplicated or Are Missing
Solution: Verify that the exact same Conversion ID is being passed from both the web GTM Pixel tag and the server-side CAPI tag, and that event names match Reddit's accepted format. Use Preview mode in both containers to confirm the Conversion ID is present in both the browser and server requests. In Reddit Events Manager, check that events are marked as healthy and that the deduplication rate is approximately 50%.
Challenge: Low Event Match Quality
Solution: Reddit requires a valid email address to improve match quality. Ensure you are passing a properly hashed and normalised email address value with your events. Review your data layer to confirm this value is available and correctly mapped in the tag configuration.
Challenge: Server Events Not Appearing in Reddit
Solution: Open the server-side GTM Preview mode and navigate to Tags, then check the Outgoing Requests section for any Reddit API error responses. These error messages will typically indicate why an event was rejected and point you toward the fix.
Step 3: Final Optimisations (Optional but Recommended)
Improve Event Match Quality
Conduct a systematic review of your data layer and the user information available across your site. Work with your development team to surface additional data points, both non-PII and hashed PII, that can be passed through the Conversions API. The richer and more accurate the data you send, the more effective your Reddit ad targeting and attribution will be.
Reduce Redundant Browser-Side Tracking
Once you are confident in the reliability of your server-side setup, consider suppressing certain Reddit Pixel tags from firing in the browser for specific users or scenarios, for example, for logged-in users where comprehensive server-side data is already being captured. This can further reduce client-side JavaScript execution and improve site performance. This is an advanced step and should be approached carefully to avoid unintended gaps in tracking coverage.