Repository navigation
Conversation
…itch, off) With the container config switch klaviyoSessionToken (served by ingest only when INGEST_KLAVIYO_SESSION_TOKEN names the workspace; init() cannot set it), a dl_kprofile_id that has a DATALYR-signed shape (dlk1 / dlk2, never a raw id) is kept, encrypted, for the browser session, never past a dlk2 token's own expiry, and added as external_ids.klaviyo to each later view_item, add_to_cart and checkout_started. Ingest verifies it on every event. A new session, withdrawn marketing consent or the switch going off drops it. Raw ids keep today's one-shot. Off: nothing stored, nothing added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…leared by reset() A token never used in its session is dropped at the next session; a session change or reset() drops it. Tests: klaviyo-session-token.test.ts (two new cases). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it does
This is part of DATALYR's Klaviyo event sending (datalyr/datalyr#884 and #898).
When a shopper clicks a DATALYR-signed link in a Klaviyo email (
dl_kprofile_id=dlk1…ordlk2…), the website script now keeps that signed token for the browser session. It attaches the token to each laterview_item,add_to_cartandcheckout_started, and ingest verifies it again on every event. Before this change, the token rode on only the first event after landing, so a later cart event could never reach the shopper's Klaviyo profile under the "trusted sources only" rule (decision R120).dl_kprofile_idkeeps today's one-shot behaviour.dlk2token is never kept past its own expiry (45 days).reset()drops it (verify N3,28c4f8c).Switch
The remote container-config key
klaviyoSessionToken, off by default.init()can never turn it on. Ingest serves it only to workspaces named inINGEST_KLAVIYO_SESSION_TOKEN(off, in datalyr/datalyr#884), and never to sensitive verticals. Turning it off clears what was kept.Reviews
reset()did not clear it. It is closed in28c4f8cwith two tests.Not built or not tested
28c4f8cis the first run.Release
This is an SDK release. After it, datalyr/datalyr repins
infra/tracking/dl.dev.jsand rebuildsdl.jsanddl.min.js, and the website-script upload carries those three. It touches no postback, ingest, queue, sync, api, cleanup, edge or webhooks files.🤖 Generated with Claude Code