Skip to content

Conversation

@jciafardone
Copy link

@jciafardone jciafardone commented Dec 6, 2025

Add Pinterest epik and _epik parameter mapping to integrationMappingExternal.

Testing:

  • Added comprehensive tests covering both epik and _epik variants
  • Tests verify capture from all three sources (query params, cookies, localStorage)
  • Tests verify proper mapping to custom flags

Background

  • Pinterest uses both epik (query parameter) and _epik (cookie) to track click IDs
  • The epik parameter is appended by Pinterest to ad click URLs
  • The _epik cookie is stored by Pinterest's tag
  • Both variants need to be captured to ensure comprehensive click ID tracking
  • Pinterest requires the click ID to be sent as Pinterest.click_id custom flag for Pinterest Conversions API (CAPI) integration
  • Currently, the SDK captures click IDs for Facebook, Google, TikTok, and Snapchat, but not Pinterest
  • This change adds Pinterest to the list of supported integration-specific identifier captures

What Has Changed

  • Added epik parameter mapping to integrationMappingExternal in integrationCapture.ts
  • Added _epik parameter mapping to integrationMappingExternal in integrationCapture.ts
  • Both epik and _epik map to Pinterest.click_id custom flag
  • Each parameter variant is checked in all three sources:
    • Query parameters (e.g., ?epik=value or ?_epik=value)
    • Cookies (e.g., epik=value or _epik=value)
    • localStorage (e.g., localStorage.getItem('epik') or localStorage.getItem('_epik'))
  • Follows standard priority resolution: query params > localStorage > cookies
  • Outputs to CUSTOM_FLAGS (consistent with other click ID integrations like gclid, fbclid, ttclid)
  • No processor function needed (unlike Facebook's fbclid which requires formatting)

Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have tested this locally.

Additional Notes

  • Tested extraction logic locally using standalone browser test file
  • Verified capture from URL query params, cookies, and localStorage for both epik and _epik variants
  • Confirmed priority resolution works correctly (query > localStorage > cookie)
  • Validated custom flag mapping to Pinterest.click_id
  • Verified that when both variants are present, both map to the same custom flag key
  • This change is additive and does not affect existing integrations
  • No breaking changes introduced

Add Pinterest _epik parameter mapping to integrationMappingExternal.

- Maps _epik to Pinterest.click_id custom flag
- Supports capture from URL query params, cookies, and localStorage
- Follows standard priority: query params > localStorage > cookies
- Outputs to CUSTOM_FLAGS (same as other click ID integrations)

Reference: https://help.pinterest.com/en/business/article/add-event-codes

Testing:
- Verified extraction from URL, cookie, and localStorage sources
- Confirmed priority resolution works correctly
- Validated custom flag mapping to Pinterest.click_id
@jciafardone jciafardone changed the base branch from master to development December 8, 2025 17:56
@rmi22186 rmi22186 force-pushed the development branch 3 times, most recently from a790359 to 0ba2d13 Compare December 10, 2025 15:31
@rmi22186 rmi22186 force-pushed the development branch 2 times, most recently from 905641c to b16bdd2 Compare December 10, 2025 21:07
jciafardone and others added 2 commits December 17, 2025 13:22
Co-authored-by: Alex S <49695018+alexs-mparticle@users.noreply.github.com>
- Add epik parameter mapping in addition to _epik
- Both epik and _epik map to Pinterest.click_id custom flag
- Support capture from query params, cookies, and localStorage
- Add comprehensive tests for both parameter variants
- Reference: https://developers.pinterest.com/docs/track-conversions/track-conversions-in-the-api/
@rmi22186
Copy link
Member

@jciafardone - looks like @alexs-mparticle 's comment here still hasn't been updated- 2dfa771#r2607709893

is his docs link correct? If so, please update.

@rmi22186
Copy link
Member

@jciafardone there's also some conflicts now, can you resolve, commit, and force push to this branch?

@jciafardone jciafardone changed the title feat(integration): add Pinterest _epik click ID capture feat(integration): add Pinterest click ID capture (epik/_epik) Jan 13, 2026
Copy link
Member

@rmi22186 rmi22186 left a comment

Choose a reason for hiding this comment

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

hit approve too soon. left one coment @jciafardone

added output for _epik
@sonarqubecloud
Copy link

@jciafardone jciafardone requested a review from rmi22186 January 16, 2026 23:28
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.

3 participants