feat: add Pinterest click ID capture (epik/_epik)#1126
Conversation
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
a790359 to
0ba2d13
Compare
905641c to
b16bdd2
Compare
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/
|
@jciafardone - looks like @alexs-mparticle 's comment here still hasn't been updated- 2dfa771#r2607709893 is his docs link correct? If so, please update. |
|
@jciafardone there's also some conflicts now, can you resolve, commit, and force push to this branch? |
rmi22186
left a comment
There was a problem hiding this comment.
hit approve too soon. left one coment @jciafardone
added output for _epik
|
| }); | ||
| }); | ||
|
|
||
| it('should map both epik and _epik to Pinterest.click_id', () => { |
Co-authored-by: Robert Ing <rmi22186@gmail.com>
…sert value is defined
|
|
hi @rmi22186 , just wanted to circle back on this. Was there anything else I needed to do on this to be able to merge? |
Stub epik in getQueryParams and expect Pinterest.click_id on events, matching the Snap integration test pattern.
PR SummaryLow Risk Overview Implements Pinterest precedence rules in Reviewed by Cursor Bugbot for commit c5abf7d. Bugbot is set up for automated code reviews on this repo. Configure here. |
Extract expectCapturedSnapchatAndPinterestFlags helper to satisfy duplication threshold on new code.
- Add expectCapturedGoogleFacebookFlags helper - Remove duplicate commerce it blocks (identical copies)
- expectStubbedIntegrationCaptureFlags wraps Google/Facebook + Snap/Pinterest - Shared commerce purchase helpers and constants - logThreeEventsUploadAndParseBatch for batch upload tests
Replace duplicated event/pageview and commerce it() bodies with CAPTURE_CUSTOM_FLAG_CASES and COMMERCE_CAPTURE_CASES tables.
…stomFlags block - Fix indentation and close describe before partner identities suite - Use stable assertions (toBeDefined + includes) per review
Sonar rule javascript:S7764 prefers globalThis over window in tests; behavior unchanged under jsdom.
Satisfies Sonar no-zero-fraction rule; value unchanged.
A missing brace nested _scid under _epik and broke integrationMappingExternal parsing. Restore _scid as a top-level key next to Pinterest entries.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 84979c4. Configure here.
Assert both Pinterest source keys are registered in filtered mappings, then that Pinterest.click_id is one of the input values (same key, last-write wins).
epik and _epik map to the same custom flag. Prefer query params over localStorage and cookies, then localStorage over cookies, mirroring Facebook fbclid/_fbc and Rokt-style precedence. Add Jest coverage for each tier.
Add clickIdsAfterFullCaptureAllMode helper; drive Pinterest, Snapchat, and Rokt #capture cases from tables; consolidate capture V2 mode gating tests.
… tests Restores Window augmentation typing for mParticle (fixes rollup TS2352). Sonar may flag window again; acceptable tradeoff.
|




Add Pinterest
epikand_epikparameter mapping tointegrationMappingExternal.epikparameter mapping to capture Pinterest click IDs_epikparameter mapping to capture Pinterest click IDsPinterest.click_idin custom flagsTesting:
epikand_epikvariantsBackground
epik(query parameter) and_epik(cookie) to track click IDsepikparameter is appended by Pinterest to ad click URLs_epikcookie is stored by Pinterest's tagPinterest.click_idcustom flag for Pinterest Conversions API (CAPI) integrationWhat Has Changed
epikparameter mapping tointegrationMappingExternalinintegrationCapture.ts_epikparameter mapping tointegrationMappingExternalinintegrationCapture.tsepikand_epikmap toPinterest.click_idcustom flag?epik=valueor?_epik=value)epik=valueor_epik=value)localStorage.getItem('epik')orlocalStorage.getItem('_epik'))CUSTOM_FLAGS(consistent with other click ID integrations likegclid,fbclid,ttclid)fbclidwhich requires formatting)Checklist
Additional Notes
epikand_epikvariantsPinterest.click_id