Skip to content

feat(cdp): convert snapchat to server-side mappings + node #31110

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

Open
wants to merge 6 commits into
base: support-mapping-tests-2
Choose a base branch
from

Conversation

MarconLP
Copy link
Member

Changes

Before

2025-04-11 at 12 58 45

After

2025-04-11 at 13 00 22

  • move server-side template to node
  • convert the server-side snapchat template to use mappings
  • adjust to our e-commerce spec
  • use arrayReduce function to calculate num_items

todos:

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

How did you test this code?

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

This PR moves the Snapchat Ads server-side template from Python to Node.js and converts it to use mappings, aligning with PostHog's e-commerce event specification.

  • Added comprehensive test suite in snapchat.template.test.ts covering single/multi-product events, error handling, and sensitive data hashing
  • Implemented proper event mapping between PostHog and Snapchat events (e.g., "Order Completed" → "PURCHASE")
  • Added support for multi-product events using arrayMap and arrayReduce functions to process product arrays
  • Removed Python implementation (template_snapchat_ads.py and its tests) while maintaining the Snapchat Pixel client-side template
  • Added the new Node.js template to the destinations list in plugin-server/src/cdp/templates/index.ts

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

@MarconLP MarconLP changed the title move snapchat server-side template to node and convert to mappings feat(cdp): convert snapchat to server-side mappings + node Apr 11, 2025
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