Skip to content

Conversation

@jciafardone
Copy link

@jciafardone jciafardone commented Dec 6, 2025

Add Pinterest _epik parameter mapping to integrationMappingExternal.

  • Added _epik parameter mapping to capture Pinterest click IDs
  • Maps to Pinterest.click_id in custom flags
  • Supports capture from query parameters, cookies, and localStorage

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

Testing:

  • Added comprehensive tests covering all three capture sources
  • Tests verify proper mapping to custom flags
  • All existing tests continue to pass

Background

  • Pinterest requires the _epik parameter to be captured and 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
  • Reference: https://help.pinterest.com/en/business/article/add-event-codes

What Has Changed

  • Added _epik parameter mapping to integrationMappingExternal in integrationCapture.ts
  • Maps _epik to Pinterest.click_id custom flag
  • Supports capture from URL query parameters, cookies, and localStorage
  • 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)

Screenshots/Video

  • N/A (backend integration change)

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
  • Confirmed priority resolution works correctly (query > localStorage > cookie)
  • Validated custom flag mapping to Pinterest.click_id
  • This change is additive and does not affect existing integrations
  • No breaking changes introduced

Reference Issue (For employees only. Ignore if you are an outside contributor)

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/
@sonarqubecloud
Copy link

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.

2 participants