Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add reddit pixel CDP destination #28493

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

robbie-c
Copy link
Member

@robbie-c robbie-c commented Feb 10, 2025

Problem

We don't have a reddit ads CDP destination yet, and a few customers have asked for it

Changes

Add a reddit pixel destination

(A future PR will contain the back-end conversions API destination)

Does this work well for both Cloud and self-hosted?

Yes

How did you test this code?

Created a test page (see PostHog/posthog-js#1725) for manual testing
Added a test class which uses https://github.com/cloudflare/stpyv8 to run the JS code, testing that given events trigger the right calls

@robbie-c robbie-c force-pushed the feat/add-wip-reddit-pixel branch from 95be0cc to d27f662 Compare February 10, 2025 21:03
@robbie-c robbie-c force-pushed the feat/add-wip-reddit-pixel branch from 2d01b0c to d9dd697 Compare February 11, 2025 14:22
@robbie-c robbie-c marked this pull request as ready for review February 11, 2025 14:24
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Added a new Reddit Pixel CDP destination that enables tracking user interactions and e-commerce events through Reddit's pixel tracking system, with comprehensive test coverage using STPyV8 for JavaScript execution.

  • Added /posthog/cdp/templates/reddit/template_reddit_pixel.py implementing standard e-commerce events (PageVisit, Search, AddToCart) with proper input validation
  • Added /posthog/cdp/templates/reddit/test_template_reddit_pixel.py with test coverage for event tracking and pixel initialization
  • Introduced BaseSiteDestinationFunctionTest in helpers.py for testing site destinations using STPyV8
  • Added stpyv8==13.1.201.22 as a development dependency for JavaScript code execution in tests
  • Integrated Reddit pixel template into CDP framework through __init__.py

6 file(s) reviewed, 7 comment(s)
Edit PR Review Bot Settings | Greptile

posthog/cdp/templates/reddit/template_reddit_pixel.py Outdated Show resolved Hide resolved
posthog/cdp/templates/reddit/test_template_reddit_pixel.py Outdated Show resolved Hide resolved
posthog/cdp/templates/helpers.py Outdated Show resolved Hide resolved
posthog/cdp/templates/helpers.py Show resolved Hide resolved
posthog/cdp/templates/helpers.py Outdated Show resolved Hide resolved
@robbie-c robbie-c force-pushed the feat/add-wip-reddit-pixel branch from 5cb1ff2 to 9ee606a Compare February 11, 2025 14:59
@robbie-c robbie-c changed the title feat: Add reddit CDP destination (WIP) feat: Add reddit pixel CDP destination Feb 11, 2025
@robbie-c robbie-c requested a review from MarconLP February 11, 2025 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant