@walkeros/web-destination-tiktok 4.2.0 → 4.2.1-next-1781538735002
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/dev.d.mts +3 -1
- package/dist/dev.d.ts +3 -1
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/examples/index.d.mts +3 -1
- package/dist/examples/index.d.ts +3 -1
- package/dist/examples/index.js +2 -1
- package/dist/examples/index.mjs +2 -1
- package/dist/walkerOS.json +17 -11
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @walkeros/web-destination-tiktok
|
|
2
2
|
|
|
3
|
+
## 4.2.1-next-1781538735002
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [5cbcd23]
|
|
8
|
+
- @walkeros/core@4.2.1-next-1781538735002
|
|
9
|
+
- @walkeros/web-core@4.2.1-next-1781538735002
|
|
10
|
+
|
|
3
11
|
## 4.2.0
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/dev.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _walkeros_core_dev from '@walkeros/core/dev';
|
|
2
2
|
import { z } from '@walkeros/core/dev';
|
|
3
|
-
import { Mapping as Mapping$1, Flow } from '@walkeros/core';
|
|
3
|
+
import { Mapping as Mapping$1, Flow, WalkerOS } from '@walkeros/core';
|
|
4
4
|
import { DestinationWeb } from '@walkeros/web-core';
|
|
5
5
|
|
|
6
6
|
declare const SettingsSchema: z.ZodObject<{
|
|
@@ -147,6 +147,8 @@ declare namespace env {
|
|
|
147
147
|
type TikTokStepExample = Flow.StepExample & {
|
|
148
148
|
settings?: Partial<Settings>;
|
|
149
149
|
configInclude?: string[];
|
|
150
|
+
/** Consent granted before `in` so a gated destination is loaded first. */
|
|
151
|
+
before?: WalkerOS.Consent;
|
|
150
152
|
};
|
|
151
153
|
/**
|
|
152
154
|
* Default event forwarding - every walkerOS event becomes a ttq.track()
|
package/dist/dev.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _walkeros_core_dev from '@walkeros/core/dev';
|
|
2
2
|
import { z } from '@walkeros/core/dev';
|
|
3
|
-
import { Mapping as Mapping$1, Flow } from '@walkeros/core';
|
|
3
|
+
import { Mapping as Mapping$1, Flow, WalkerOS } from '@walkeros/core';
|
|
4
4
|
import { DestinationWeb } from '@walkeros/web-core';
|
|
5
5
|
|
|
6
6
|
declare const SettingsSchema: z.ZodObject<{
|
|
@@ -147,6 +147,8 @@ declare namespace env {
|
|
|
147
147
|
type TikTokStepExample = Flow.StepExample & {
|
|
148
148
|
settings?: Partial<Settings>;
|
|
149
149
|
configInclude?: string[];
|
|
150
|
+
/** Consent granted before `in` so a gated destination is loaded first. */
|
|
151
|
+
before?: WalkerOS.Consent;
|
|
150
152
|
};
|
|
151
153
|
/**
|
|
152
154
|
* Default event forwarding - every walkerOS event becomes a ttq.track()
|
package/dist/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,o=(e,a)=>{for(var n in a)t(e,n,{get:a[n],enumerable:!0})},r={};o(r,{examples:()=>
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,o=(e,a)=>{for(var n in a)t(e,n,{get:a[n],enumerable:!0})},r={};o(r,{examples:()=>v,schemas:()=>d}),module.exports=(e=r,((e,o,r,d)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let c of n(o))i.call(e,c)||c===r||t(e,c,{get:()=>o[c],enumerable:!(d=a(o,c))||d.enumerable});return e})(t({},"__esModule",{value:!0}),e));var d={};o(d,{MappingSchema:()=>u,SettingsSchema:()=>s,mapping:()=>k,settings:()=>m});var c=require("@walkeros/core/dev"),l=require("@walkeros/core/dev"),s=l.z.object({apiKey:l.z.string().min(1).describe('Your TikTok Pixel ID. Find it in TikTok Ads Manager under "Assets" → "Events" → "Web Events" → select your pixel → "Setup Web Event" → "Pixel ID".'),auto_config:l.z.boolean().describe("TikTok default: true. Enable automatic form field detection for Advanced Matching.").optional(),limited_data_use:l.z.boolean().describe("TikTok default: false. Restrict data use for compliance with U.S. state privacy laws.").optional(),identify:l.z.unknown().describe("walkerOS mapping value resolving to an Advanced Matching object with any of: email, phone_number, external_id. All values are auto-hashed (SHA256) by the TikTok SDK before sending.").optional()}),p=require("@walkeros/core/dev"),u=p.z.object({identify:p.z.unknown().describe("Per-event Advanced Matching mapping. Resolves to an object with any of: email, phone_number, external_id. Overrides destination-level settings.identify for this rule.").optional()}),m=(0,c.zodToSchema)(s),k=(0,c.zodToSchema)(u),v={};o(v,{env:()=>g,step:()=>q});var g={};o(g,{init:()=>h,push:()=>_,simulation:()=>w});var b=()=>{};function f(){const e=()=>{};return e.load=b,e.page=b,e.track=b,e.identify=b,e.enableCookie=b,e.disableCookie=b,e.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie"],e._i={},e.loaded=!0,e}function y(){return{window:{ttq:f()},document:{createElement:()=>({src:"",async:!1}),head:{appendChild:b}}}}var h=y(),_=y(),w=["call:ttq.load","call:ttq.track","call:ttq.identify","call:ttq.page","call:ttq.enableCookie","call:ttq.disableCookie"],q={};o(q,{consentGrantEnableCookie:()=>I,consentRevokeDisableCookie:()=>O,defaultEventForwarding:()=>T,destinationLevelIdentify:()=>x,destinationLevelInclude:()=>R,orderCompleteCompletePayment:()=>z,productViewContent:()=>S,ruleIncludeReplaces:()=>A,searchSubmitSearch:()=>j,userRegisterCompleteRegistration:()=>P,wildcardIgnored:()=>E});var C=require("@walkeros/core"),T={title:"Default track",description:"Without a mapping the walker event name is forwarded to ttq.track with an event_id for TikTok dedup.",in:(0,C.getEvent)("product view",{id:"0123456789abcdef"}),out:[["ttq.track","product view",{},{event_id:"0123456789abcdef"}]]},E={public:!1,in:(0,C.getEvent)("product view"),mapping:{ignore:!0},out:[]},S={title:"View content",description:"A product view is renamed to the TikTok ViewContent standard event with content_type, id, value, and currency.",in:(0,C.getEvent)("product view",{id:"11111111aaaaaaaa"}),mapping:{name:"ViewContent",data:{map:{content_type:{value:"product"},content_id:"data.id",content_name:"data.name",content_category:"data.category",value:"data.price",currency:{key:"globals.currency",value:"EUR"}}},include:[]},out:[["ttq.track","ViewContent",{content_type:"product",content_id:"ers",content_name:"Everyday Ruck Snack",value:420,currency:"EUR"},{event_id:"11111111aaaaaaaa"}]]},R={title:"Include data",description:"Destination-level include flattens the event data section into prefixed TikTok event parameters.",in:(0,C.getEvent)("product view",{id:"22222222bbbbbbbb"}),configInclude:["data"],out:[["ttq.track","product view",{data_id:"ers",data_name:"Everyday Ruck Snack",data_color:"black",data_size:"l",data_price:420},{event_id:"22222222bbbbbbbb"}]]},A={title:"Rule include overrides",description:"A per-rule include replaces the destination-level include so this event forwards only globals.",in:(0,C.getEvent)("order complete",{id:"33333333cccccccc"}),configInclude:["data"],mapping:{include:["globals"]},out:[["ttq.track","order complete",{globals_pagegroup:"shop"},{event_id:"33333333cccccccc"}]]},x={title:"Advanced matching",description:"Destination-level identify calls ttq.identify with email, phone, and external id for TikTok advanced matching.",in:(0,C.getEvent)("page view",{id:"44444444dddddddd",data:{email:"user@acme.com",phone:"+14135552671"}}),settings:{identify:{map:{email:"data.email",phone_number:"data.phone",external_id:"user.id"}}},out:[["ttq.identify",{email:"user@acme.com",phone_number:"+14135552671",external_id:"us3r"}],["ttq.track","page view",{},{event_id:"44444444dddddddd"}]]},P={title:"Complete registration",description:"A user register fires ttq.identify for advanced matching and then tracks CompleteRegistration.",in:(0,C.getEvent)("user register",{id:"55555555eeeeeeee",data:{email:"new@acme.com",phone:"+14135551234",user_id:"new-user-123"}}),mapping:{name:"CompleteRegistration",include:[],data:{map:{content_type:{value:"product"}}},settings:{identify:{map:{email:"data.email",phone_number:"data.phone",external_id:"data.user_id"}}}},out:[["ttq.identify",{email:"new@acme.com",phone_number:"+14135551234",external_id:"new-user-123"}],["ttq.track","CompleteRegistration",{content_type:"product"},{event_id:"55555555eeeeeeee"}]]},z={title:"Complete payment",description:"A completed order is mapped to TikTok CompletePayment with value, currency, and nested product contents.",in:(0,C.getEvent)("order complete",{id:"66666666ffffffff"}),mapping:{name:"CompletePayment",data:{map:{content_type:{value:"product"},value:"data.total",currency:{key:"data.currency",value:"EUR"},order_id:"data.id",contents:{loop:["nested",{map:{content_id:"data.id",content_name:"data.name",quantity:{key:"data.quantity",value:1},price:"data.price"}}]}}},include:[]},out:[["ttq.track","CompletePayment",{content_type:"product",value:555,currency:"EUR",order_id:"0rd3r1d",contents:[{content_id:"ers",content_name:"Everyday Ruck Snack",quantity:1,price:420},{content_id:"cc",content_name:"Cool Cap",quantity:1,price:42},{content_name:"Surprise",quantity:1}]},{event_id:"66666666ffffffff"}]]},j={title:"Search",description:"A search submit fires TikTok Search with the query field mapped from event data.",in:(0,C.getEvent)("search submit",{id:"777777770000aaaa",data:{term:"hiking backpack"}}),mapping:{name:"Search",data:{map:{query:"data.term"}},include:[]},out:[["ttq.track","Search",{query:"hiking backpack"},{event_id:"777777770000aaaa"}]]},I={title:"Consent granted",description:"A walker consent grant for marketing calls ttq.enableCookie so TikTok can set and read its attribution cookie.",command:"consent",in:{marketing:!0},settings:{},out:[["ttq.enableCookie"]]},O={title:"Consent revoked",description:"A walker consent revoke for marketing calls ttq.disableCookie so TikTok stops using its first-party cookie.",command:"consent",before:{marketing:!0},in:{marketing:!1},settings:{},out:[["ttq.enableCookie"],["ttq.disableCookie"]]};//# sourceMappingURL=dev.js.map
|
package/dist/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n apiKey: z\n .string()\n .min(1)\n .describe(\n 'Your TikTok Pixel ID. Find it in TikTok Ads Manager under \"Assets\" → \"Events\" → \"Web Events\" → select your pixel → \"Setup Web Event\" → \"Pixel ID\".',\n ),\n // `pageview` removed 2026-04-09 — TikTok's SDK fires auto page view and\n // the knob was unreliable. Let it fire; don't expose a toggle.\n auto_config: z\n .boolean()\n .describe(\n 'TikTok default: true. Enable automatic form field detection for Advanced Matching.',\n )\n .optional(),\n limited_data_use: z\n .boolean()\n .describe(\n 'TikTok default: false. Restrict data use for compliance with U.S. state privacy laws.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to an Advanced Matching object with any of: email, phone_number, external_id. All values are auto-hashed (SHA256) by the TikTok SDK before sending.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event Advanced Matching mapping. Resolves to an object with any of: email, phone_number, external_id. Overrides destination-level settings.identify for this rule.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, TTQ } from '../types';\n\nconst noop = () => {};\n\n/** Build a fresh mock ttq — each call returns a new object so tests can mutate independently. */\nfunction makeMockTTQ(): TTQ {\n const fn = (() => {}) as unknown as TTQ;\n fn.load = noop;\n fn.page = noop;\n fn.track = noop;\n fn.identify = noop;\n fn.enableCookie = noop;\n fn.disableCookie = noop;\n fn.methods = [\n 'page',\n 'track',\n 'identify',\n 'instances',\n 'debug',\n 'on',\n 'off',\n 'once',\n 'ready',\n 'alias',\n 'group',\n 'enableCookie',\n 'disableCookie',\n ];\n fn._i = {};\n fn.loaded = true;\n return fn;\n}\n\n/**\n * Minimal web env — window has a mock ttq. document has the bare minimum\n * for addScript() (createElement + head.appendChild), with no-op\n * implementations so init() can run without a real DOM.\n */\nfunction makeEnv(): Env {\n return {\n window: {\n ttq: makeMockTTQ(),\n },\n document: {\n createElement: () =>\n ({\n src: '',\n async: false,\n }) as unknown as Element,\n head: { appendChild: noop },\n },\n };\n}\n\n/**\n * Pre-init env — destination init() call will set up ttq and load the\n * script. Tests receive this as a starting point.\n */\nexport const init: Env = makeEnv();\n\n/**\n * Post-init env — same shape; the test runner clones this and replaces\n * individual ttq methods with jest.fn() so it can assert on calls.\n */\nexport const push: Env = makeEnv();\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = [\n 'call:ttq.load',\n 'call:ttq.track',\n 'call:ttq.identify',\n 'call:ttq.page',\n 'call:ttq.enableCookie',\n 'call:ttq.disableCookie',\n];\n","import type { Flow, WalkerOS } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Examples may optionally carry destination-level settings. The test\n * runner reads `settings` from the example and merges it into the base\n * destination settings on top of the fixed apiKey.\n */\nexport type TikTokStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n configInclude?: string[];\n};\n\n/**\n * Default event forwarding - every walkerOS event becomes a ttq.track()\n * call. With no mapping and no destination-level include, the params\n * object is empty. event_id is always passed as the 3rd argument (TikTok\n * dedup between pixel and Events API).\n *\n * NOTE: The raw walkerOS event name \"product view\" (with space) is NOT a\n * TikTok standard event. Without a mapping.name override, TikTok treats\n * it as a custom event - functional for audience building, no\n * optimization. The next example shows the recommended override.\n */\nexport const defaultEventForwarding: TikTokStepExample = {\n title: 'Default track',\n description:\n 'Without a mapping the walker event name is forwarded to ttq.track with an event_id for TikTok dedup.',\n in: getEvent('product view', { id: '0123456789abcdef' }),\n out: [['ttq.track', 'product view', {}, { event_id: '0123456789abcdef' }]],\n};\n\n/**\n * Wildcard ignore - walkerOS's standard way to drop events. The rule\n * matches but does nothing. The destination fires zero SDK calls.\n */\nexport const wildcardIgnored: TikTokStepExample = {\n public: false,\n in: getEvent('product view'),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * The canonical TikTok pattern: walkerOS \"product view\" → TikTok\n * \"ViewContent\" via mapping.name. mapping.data builds the TikTok-native\n * parameter shape (content_type, content_id, content_name, value,\n * currency). include is explicitly set to [] so prefixed walkerOS\n * properties don't leak onto the call and confuse TikTok's matcher.\n */\nexport const productViewContent: TikTokStepExample = {\n title: 'View content',\n description:\n 'A product view is renamed to the TikTok ViewContent standard event with content_type, id, value, and currency.',\n in: getEvent('product view', { id: '11111111aaaaaaaa' }),\n mapping: {\n name: 'ViewContent',\n data: {\n map: {\n content_type: { value: 'product' },\n content_id: 'data.id',\n content_name: 'data.name',\n content_category: 'data.category',\n value: 'data.price',\n currency: { key: 'globals.currency', value: 'EUR' },\n },\n },\n include: [],\n },\n out: [\n [\n 'ttq.track',\n 'ViewContent',\n {\n content_type: 'product',\n content_id: 'ers',\n content_name: 'Everyday Ruck Snack',\n // content_category is absent from the default product view fixture;\n // the mapper skips undefined resolutions.\n value: 420,\n currency: 'EUR', // fallback - default fixture has no globals.currency\n },\n { event_id: '11111111aaaaaaaa' },\n ],\n ],\n};\n\n/**\n * Destination-level settings.include flattens the walkerOS `data` section\n * into prefixed TikTok event parameters on every push. This is the\n * \"dump everything\" mode - useful for custom events where TikTok won't\n * do optimization anyway, and no mapping.data is needed.\n */\nexport const destinationLevelInclude: TikTokStepExample = {\n title: 'Include data',\n description:\n 'Destination-level include flattens the event data section into prefixed TikTok event parameters.',\n in: getEvent('product view', { id: '22222222bbbbbbbb' }),\n configInclude: ['data'],\n out: [\n [\n 'ttq.track',\n 'product view',\n {\n data_id: 'ers',\n data_name: 'Everyday Ruck Snack',\n data_color: 'black',\n data_size: 'l',\n data_price: 420,\n },\n { event_id: '22222222bbbbbbbb' },\n ],\n ],\n};\n\n/**\n * Per-rule settings.include REPLACES destination-level include for the\n * matched rule (design doc §6: mapping-level include replaces, not\n * merges with, destination-level include).\n */\nexport const ruleIncludeReplaces: TikTokStepExample = {\n title: 'Rule include overrides',\n description:\n 'A per-rule include replaces the destination-level include so this event forwards only globals.',\n in: getEvent('order complete', { id: '33333333cccccccc' }),\n configInclude: ['data'],\n mapping: {\n include: ['globals'],\n },\n out: [\n [\n 'ttq.track',\n 'order complete',\n {\n globals_pagegroup: 'shop',\n },\n { event_id: '33333333cccccccc' },\n ],\n ],\n};\n\n/**\n * Destination-level settings.identify fires on the first push (once the\n * state cache is empty). Advanced Matching parameters (email,\n * phone_number, external_id) are passed to ttq.identify() which\n * auto-hashes them SHA256 before sending. Subsequent pushes with\n * unchanged values do NOT re-fire ttq.identify() - runtime state tracks\n * the last-resolved identity.\n *\n * walkerOS's default user fixture has user.id='us3r' and no email/phone,\n * so the example injects data and maps from there.\n */\nexport const destinationLevelIdentify: TikTokStepExample = {\n title: 'Advanced matching',\n description:\n 'Destination-level identify calls ttq.identify with email, phone, and external id for TikTok advanced matching.',\n in: getEvent('page view', {\n id: '44444444dddddddd',\n data: {\n email: 'user@acme.com',\n phone: '+14135552671',\n },\n }),\n settings: {\n identify: {\n map: {\n email: 'data.email',\n phone_number: 'data.phone',\n external_id: 'user.id',\n },\n },\n },\n out: [\n [\n 'ttq.identify',\n {\n email: 'user@acme.com',\n phone_number: '+14135552671',\n external_id: 'us3r',\n },\n ],\n ['ttq.track', 'page view', {}, { event_id: '44444444dddddddd' }],\n ],\n};\n\n/**\n * User registration → CompleteRegistration standard event with per-event\n * identify. The user just provided their email + phone, so this is the\n * moment to fire Advanced Matching for this session. The per-event\n * identify overrides any destination-level identify for this one push.\n */\nexport const userRegisterCompleteRegistration: TikTokStepExample = {\n title: 'Complete registration',\n description:\n 'A user register fires ttq.identify for advanced matching and then tracks CompleteRegistration.',\n in: getEvent('user register', {\n id: '55555555eeeeeeee',\n data: {\n email: 'new@acme.com',\n phone: '+14135551234',\n user_id: 'new-user-123',\n },\n }),\n mapping: {\n name: 'CompleteRegistration',\n include: [],\n data: {\n map: {\n content_type: { value: 'product' },\n },\n },\n settings: {\n identify: {\n map: {\n email: 'data.email',\n phone_number: 'data.phone',\n external_id: 'data.user_id',\n },\n },\n },\n },\n out: [\n [\n 'ttq.identify',\n {\n email: 'new@acme.com',\n phone_number: '+14135551234',\n external_id: 'new-user-123',\n },\n ],\n [\n 'ttq.track',\n 'CompleteRegistration',\n {\n content_type: 'product',\n },\n { event_id: '55555555eeeeeeee' },\n ],\n ],\n};\n\n/**\n * Multi-product order → CompletePayment standard event. The canonical\n * TikTok ecommerce pattern:\n * - mapping.name flips the walkerOS event to TikTok's rigid taxonomy\n * - mapping.data builds the TikTok-native parameter shape\n * - loop iterates event.nested to produce the `contents` array, one\n * entry per product\n * - { key, value: 'EUR' } provides a currency fallback if data.currency\n * is absent (here data.currency is 'EUR' so the key wins)\n *\n * The default \"order complete\" fixture has 3 nested entries: two\n * products (ers, cc) and one gift (Surprise - no id, no price).\n */\nexport const orderCompleteCompletePayment: TikTokStepExample = {\n title: 'Complete payment',\n description:\n 'A completed order is mapped to TikTok CompletePayment with value, currency, and nested product contents.',\n in: getEvent('order complete', { id: '66666666ffffffff' }),\n mapping: {\n name: 'CompletePayment',\n data: {\n map: {\n content_type: { value: 'product' },\n value: 'data.total',\n currency: { key: 'data.currency', value: 'EUR' },\n order_id: 'data.id',\n contents: {\n loop: [\n 'nested',\n {\n map: {\n content_id: 'data.id',\n content_name: 'data.name',\n quantity: { key: 'data.quantity', value: 1 },\n price: 'data.price',\n },\n },\n ],\n },\n },\n },\n include: [],\n },\n out: [\n [\n 'ttq.track',\n 'CompletePayment',\n {\n content_type: 'product',\n value: 555,\n currency: 'EUR',\n order_id: '0rd3r1d',\n contents: [\n {\n content_id: 'ers',\n content_name: 'Everyday Ruck Snack',\n quantity: 1, // fallback - fixture has no data.quantity\n price: 420,\n },\n {\n content_id: 'cc',\n content_name: 'Cool Cap',\n quantity: 1,\n price: 42,\n },\n {\n // gift entry - { name: 'Surprise' }, no id and no price.\n // walkerOS map skips keys whose resolved value is undefined.\n content_name: 'Surprise',\n quantity: 1,\n },\n ],\n },\n { event_id: '66666666ffffffff' },\n ],\n ],\n};\n\n/**\n * Search → TikTok Search standard event. Minimal example that shows how\n * a walkerOS search event flips through mapping.name with a single\n * mapping.data field (the query string).\n */\nexport const searchSubmitSearch: TikTokStepExample = {\n title: 'Search',\n description:\n 'A search submit fires TikTok Search with the query field mapped from event data.',\n in: getEvent('search submit', {\n id: '777777770000aaaa',\n data: {\n term: 'hiking backpack',\n },\n }),\n mapping: {\n name: 'Search',\n data: {\n map: {\n query: 'data.term',\n },\n },\n include: [],\n },\n out: [\n [\n 'ttq.track',\n 'Search',\n {\n query: 'hiking backpack',\n },\n { event_id: '777777770000aaaa' },\n ],\n ],\n};\n\n/**\n * Consent granted → ttq.enableCookie(). The destination checks the\n * consent keys declared in config.consent (here \"marketing\" - TikTok is\n * an ad platform, not analytics) and toggles cookie behavior.\n *\n * Uses the canonical StepExample.command='consent' pattern: the test\n * runner dispatches via elb('walker consent', in) instead of pushing\n * an event.\n */\nexport const consentGrantEnableCookie: TikTokStepExample = {\n title: 'Consent granted',\n description:\n 'A walker consent grant for marketing calls ttq.enableCookie so TikTok can set and read its attribution cookie.',\n command: 'consent',\n in: { marketing: true } as WalkerOS.Consent,\n settings: {} as Partial<Settings>, // consent key is derived from config.consent\n out: [['ttq.enableCookie']],\n};\n\n/**\n * Consent revoked → ttq.disableCookie(). TikTok stops setting and\n * reading its first-party cookie (_ttp) for attribution.\n */\nexport const consentRevokeDisableCookie: TikTokStepExample = {\n title: 'Consent revoked',\n description:\n 'A walker consent revoke for marketing calls ttq.disableCookie so TikTok stops using its first-party cookie.',\n command: 'consent',\n in: { marketing: false } as WalkerOS.Consent,\n settings: {} as Partial<Settings>,\n out: [['ttq.disableCookie']],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACrC,QAAQ,aACL,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA;AAAA;AAAA,EAGF,aAAa,aACV,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,kBAAkB,aACf,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,aACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AC7BD,IAAAC,cAAkB;AAEX,IAAM,gBAAgB,cAAE,OAAO;AAAA,EACpC,UAAU,cACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AFDM,IAAM,eAAW,yBAAY,cAAc;AAC3C,IAAM,cAAU,yBAAY,aAAa;;;AGThD;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAM,OAAO,MAAM;AAAC;AAGpB,SAAS,cAAmB;AAC1B,QAAM,MAAM,MAAM;AAAA,EAAC;AACnB,KAAG,OAAO;AACV,KAAG,OAAO;AACV,KAAG,QAAQ;AACX,KAAG,WAAW;AACd,KAAG,eAAe;AAClB,KAAG,gBAAgB;AACnB,KAAG,UAAU;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;A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AAAA,EACZ;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,QACE,OAAO;AAAA,MACT;AAAA,MACA,EAAE,UAAU,mBAAmB;AAAA,IACjC;AAAA,EACF;AACF;AAWO,IAAM,2BAA8C;AAAA,EACzD,OAAO;AAAA,EACP,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,KAAK;AAAA,EACtB,UAAU,CAAC;AAAA;AAAA,EACX,KAAK,CAAC,CAAC,kBAAkB,CAAC;AAC5B;AAMO,IAAM,6BAAgD;AAAA,EAC3D,OAAO;AAAA,EACP,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,MAAM;AAAA,EACvB,UAAU,CAAC;AAAA,EACX,KAAK,CAAC,CAAC,mBAAmB,CAAC;AAC7B;","names":["import_dev","import_dev"]}
|
|
1
|
+
{"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n apiKey: z\n .string()\n .min(1)\n .describe(\n 'Your TikTok Pixel ID. Find it in TikTok Ads Manager under \"Assets\" → \"Events\" → \"Web Events\" → select your pixel → \"Setup Web Event\" → \"Pixel ID\".',\n ),\n // `pageview` removed 2026-04-09 — TikTok's SDK fires auto page view and\n // the knob was unreliable. Let it fire; don't expose a toggle.\n auto_config: z\n .boolean()\n .describe(\n 'TikTok default: true. Enable automatic form field detection for Advanced Matching.',\n )\n .optional(),\n limited_data_use: z\n .boolean()\n .describe(\n 'TikTok default: false. Restrict data use for compliance with U.S. state privacy laws.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to an Advanced Matching object with any of: email, phone_number, external_id. All values are auto-hashed (SHA256) by the TikTok SDK before sending.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event Advanced Matching mapping. Resolves to an object with any of: email, phone_number, external_id. Overrides destination-level settings.identify for this rule.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, TTQ } from '../types';\n\nconst noop = () => {};\n\n/** Build a fresh mock ttq — each call returns a new object so tests can mutate independently. */\nfunction makeMockTTQ(): TTQ {\n const fn = (() => {}) as unknown as TTQ;\n fn.load = noop;\n fn.page = noop;\n fn.track = noop;\n fn.identify = noop;\n fn.enableCookie = noop;\n fn.disableCookie = noop;\n fn.methods = [\n 'page',\n 'track',\n 'identify',\n 'instances',\n 'debug',\n 'on',\n 'off',\n 'once',\n 'ready',\n 'alias',\n 'group',\n 'enableCookie',\n 'disableCookie',\n ];\n fn._i = {};\n fn.loaded = true;\n return fn;\n}\n\n/**\n * Minimal web env — window has a mock ttq. document has the bare minimum\n * for addScript() (createElement + head.appendChild), with no-op\n * implementations so init() can run without a real DOM.\n */\nfunction makeEnv(): Env {\n return {\n window: {\n ttq: makeMockTTQ(),\n },\n document: {\n createElement: () =>\n ({\n src: '',\n async: false,\n }) as unknown as Element,\n head: { appendChild: noop },\n },\n };\n}\n\n/**\n * Pre-init env — destination init() call will set up ttq and load the\n * script. Tests receive this as a starting point.\n */\nexport const init: Env = makeEnv();\n\n/**\n * Post-init env — same shape; the test runner clones this and replaces\n * individual ttq methods with jest.fn() so it can assert on calls.\n */\nexport const push: Env = makeEnv();\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = [\n 'call:ttq.load',\n 'call:ttq.track',\n 'call:ttq.identify',\n 'call:ttq.page',\n 'call:ttq.enableCookie',\n 'call:ttq.disableCookie',\n];\n","import type { Flow, WalkerOS } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Examples may optionally carry destination-level settings. The test\n * runner reads `settings` from the example and merges it into the base\n * destination settings on top of the fixed apiKey.\n */\nexport type TikTokStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n configInclude?: string[];\n /** Consent granted before `in` so a gated destination is loaded first. */\n before?: WalkerOS.Consent;\n};\n\n/**\n * Default event forwarding - every walkerOS event becomes a ttq.track()\n * call. With no mapping and no destination-level include, the params\n * object is empty. event_id is always passed as the 3rd argument (TikTok\n * dedup between pixel and Events API).\n *\n * NOTE: The raw walkerOS event name \"product view\" (with space) is NOT a\n * TikTok standard event. Without a mapping.name override, TikTok treats\n * it as a custom event - functional for audience building, no\n * optimization. The next example shows the recommended override.\n */\nexport const defaultEventForwarding: TikTokStepExample = {\n title: 'Default track',\n description:\n 'Without a mapping the walker event name is forwarded to ttq.track with an event_id for TikTok dedup.',\n in: getEvent('product view', { id: '0123456789abcdef' }),\n out: [['ttq.track', 'product view', {}, { event_id: '0123456789abcdef' }]],\n};\n\n/**\n * Wildcard ignore - walkerOS's standard way to drop events. The rule\n * matches but does nothing. The destination fires zero SDK calls.\n */\nexport const wildcardIgnored: TikTokStepExample = {\n public: false,\n in: getEvent('product view'),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * The canonical TikTok pattern: walkerOS \"product view\" → TikTok\n * \"ViewContent\" via mapping.name. mapping.data builds the TikTok-native\n * parameter shape (content_type, content_id, content_name, value,\n * currency). include is explicitly set to [] so prefixed walkerOS\n * properties don't leak onto the call and confuse TikTok's matcher.\n */\nexport const productViewContent: TikTokStepExample = {\n title: 'View content',\n description:\n 'A product view is renamed to the TikTok ViewContent standard event with content_type, id, value, and currency.',\n in: getEvent('product view', { id: '11111111aaaaaaaa' }),\n mapping: {\n name: 'ViewContent',\n data: {\n map: {\n content_type: { value: 'product' },\n content_id: 'data.id',\n content_name: 'data.name',\n content_category: 'data.category',\n value: 'data.price',\n currency: { key: 'globals.currency', value: 'EUR' },\n },\n },\n include: [],\n },\n out: [\n [\n 'ttq.track',\n 'ViewContent',\n {\n content_type: 'product',\n content_id: 'ers',\n content_name: 'Everyday Ruck Snack',\n // content_category is absent from the default product view fixture;\n // the mapper skips undefined resolutions.\n value: 420,\n currency: 'EUR', // fallback - default fixture has no globals.currency\n },\n { event_id: '11111111aaaaaaaa' },\n ],\n ],\n};\n\n/**\n * Destination-level settings.include flattens the walkerOS `data` section\n * into prefixed TikTok event parameters on every push. This is the\n * \"dump everything\" mode - useful for custom events where TikTok won't\n * do optimization anyway, and no mapping.data is needed.\n */\nexport const destinationLevelInclude: TikTokStepExample = {\n title: 'Include data',\n description:\n 'Destination-level include flattens the event data section into prefixed TikTok event parameters.',\n in: getEvent('product view', { id: '22222222bbbbbbbb' }),\n configInclude: ['data'],\n out: [\n [\n 'ttq.track',\n 'product view',\n {\n data_id: 'ers',\n data_name: 'Everyday Ruck Snack',\n data_color: 'black',\n data_size: 'l',\n data_price: 420,\n },\n { event_id: '22222222bbbbbbbb' },\n ],\n ],\n};\n\n/**\n * Per-rule settings.include REPLACES destination-level include for the\n * matched rule (design doc §6: mapping-level include replaces, not\n * merges with, destination-level include).\n */\nexport const ruleIncludeReplaces: TikTokStepExample = {\n title: 'Rule include overrides',\n description:\n 'A per-rule include replaces the destination-level include so this event forwards only globals.',\n in: getEvent('order complete', { id: '33333333cccccccc' }),\n configInclude: ['data'],\n mapping: {\n include: ['globals'],\n },\n out: [\n [\n 'ttq.track',\n 'order complete',\n {\n globals_pagegroup: 'shop',\n },\n { event_id: '33333333cccccccc' },\n ],\n ],\n};\n\n/**\n * Destination-level settings.identify fires on the first push (once the\n * state cache is empty). Advanced Matching parameters (email,\n * phone_number, external_id) are passed to ttq.identify() which\n * auto-hashes them SHA256 before sending. Subsequent pushes with\n * unchanged values do NOT re-fire ttq.identify() - runtime state tracks\n * the last-resolved identity.\n *\n * walkerOS's default user fixture has user.id='us3r' and no email/phone,\n * so the example injects data and maps from there.\n */\nexport const destinationLevelIdentify: TikTokStepExample = {\n title: 'Advanced matching',\n description:\n 'Destination-level identify calls ttq.identify with email, phone, and external id for TikTok advanced matching.',\n in: getEvent('page view', {\n id: '44444444dddddddd',\n data: {\n email: 'user@acme.com',\n phone: '+14135552671',\n },\n }),\n settings: {\n identify: {\n map: {\n email: 'data.email',\n phone_number: 'data.phone',\n external_id: 'user.id',\n },\n },\n },\n out: [\n [\n 'ttq.identify',\n {\n email: 'user@acme.com',\n phone_number: '+14135552671',\n external_id: 'us3r',\n },\n ],\n ['ttq.track', 'page view', {}, { event_id: '44444444dddddddd' }],\n ],\n};\n\n/**\n * User registration → CompleteRegistration standard event with per-event\n * identify. The user just provided their email + phone, so this is the\n * moment to fire Advanced Matching for this session. The per-event\n * identify overrides any destination-level identify for this one push.\n */\nexport const userRegisterCompleteRegistration: TikTokStepExample = {\n title: 'Complete registration',\n description:\n 'A user register fires ttq.identify for advanced matching and then tracks CompleteRegistration.',\n in: getEvent('user register', {\n id: '55555555eeeeeeee',\n data: {\n email: 'new@acme.com',\n phone: '+14135551234',\n user_id: 'new-user-123',\n },\n }),\n mapping: {\n name: 'CompleteRegistration',\n include: [],\n data: {\n map: {\n content_type: { value: 'product' },\n },\n },\n settings: {\n identify: {\n map: {\n email: 'data.email',\n phone_number: 'data.phone',\n external_id: 'data.user_id',\n },\n },\n },\n },\n out: [\n [\n 'ttq.identify',\n {\n email: 'new@acme.com',\n phone_number: '+14135551234',\n external_id: 'new-user-123',\n },\n ],\n [\n 'ttq.track',\n 'CompleteRegistration',\n {\n content_type: 'product',\n },\n { event_id: '55555555eeeeeeee' },\n ],\n ],\n};\n\n/**\n * Multi-product order → CompletePayment standard event. The canonical\n * TikTok ecommerce pattern:\n * - mapping.name flips the walkerOS event to TikTok's rigid taxonomy\n * - mapping.data builds the TikTok-native parameter shape\n * - loop iterates event.nested to produce the `contents` array, one\n * entry per product\n * - { key, value: 'EUR' } provides a currency fallback if data.currency\n * is absent (here data.currency is 'EUR' so the key wins)\n *\n * The default \"order complete\" fixture has 3 nested entries: two\n * products (ers, cc) and one gift (Surprise - no id, no price).\n */\nexport const orderCompleteCompletePayment: TikTokStepExample = {\n title: 'Complete payment',\n description:\n 'A completed order is mapped to TikTok CompletePayment with value, currency, and nested product contents.',\n in: getEvent('order complete', { id: '66666666ffffffff' }),\n mapping: {\n name: 'CompletePayment',\n data: {\n map: {\n content_type: { value: 'product' },\n value: 'data.total',\n currency: { key: 'data.currency', value: 'EUR' },\n order_id: 'data.id',\n contents: {\n loop: [\n 'nested',\n {\n map: {\n content_id: 'data.id',\n content_name: 'data.name',\n quantity: { key: 'data.quantity', value: 1 },\n price: 'data.price',\n },\n },\n ],\n },\n },\n },\n include: [],\n },\n out: [\n [\n 'ttq.track',\n 'CompletePayment',\n {\n content_type: 'product',\n value: 555,\n currency: 'EUR',\n order_id: '0rd3r1d',\n contents: [\n {\n content_id: 'ers',\n content_name: 'Everyday Ruck Snack',\n quantity: 1, // fallback - fixture has no data.quantity\n price: 420,\n },\n {\n content_id: 'cc',\n content_name: 'Cool Cap',\n quantity: 1,\n price: 42,\n },\n {\n // gift entry - { name: 'Surprise' }, no id and no price.\n // walkerOS map skips keys whose resolved value is undefined.\n content_name: 'Surprise',\n quantity: 1,\n },\n ],\n },\n { event_id: '66666666ffffffff' },\n ],\n ],\n};\n\n/**\n * Search → TikTok Search standard event. Minimal example that shows how\n * a walkerOS search event flips through mapping.name with a single\n * mapping.data field (the query string).\n */\nexport const searchSubmitSearch: TikTokStepExample = {\n title: 'Search',\n description:\n 'A search submit fires TikTok Search with the query field mapped from event data.',\n in: getEvent('search submit', {\n id: '777777770000aaaa',\n data: {\n term: 'hiking backpack',\n },\n }),\n mapping: {\n name: 'Search',\n data: {\n map: {\n query: 'data.term',\n },\n },\n include: [],\n },\n out: [\n [\n 'ttq.track',\n 'Search',\n {\n query: 'hiking backpack',\n },\n { event_id: '777777770000aaaa' },\n ],\n ],\n};\n\n/**\n * Consent granted → ttq.enableCookie(). The destination checks the\n * consent keys declared in config.consent (here \"marketing\" - TikTok is\n * an ad platform, not analytics) and toggles cookie behavior.\n *\n * Uses the canonical StepExample.command='consent' pattern: the test\n * runner dispatches via elb('walker consent', in) instead of pushing\n * an event.\n */\nexport const consentGrantEnableCookie: TikTokStepExample = {\n title: 'Consent granted',\n description:\n 'A walker consent grant for marketing calls ttq.enableCookie so TikTok can set and read its attribution cookie.',\n command: 'consent',\n in: { marketing: true } as WalkerOS.Consent,\n settings: {} as Partial<Settings>, // consent key is derived from config.consent\n out: [['ttq.enableCookie']],\n};\n\n/**\n * Consent revoked → ttq.disableCookie(). TikTok stops setting and\n * reading its first-party cookie (_ttp) for attribution.\n */\nexport const consentRevokeDisableCookie: TikTokStepExample = {\n title: 'Consent revoked',\n description:\n 'A walker consent revoke for marketing calls ttq.disableCookie so TikTok stops using its first-party cookie.',\n command: 'consent',\n before: { marketing: true },\n in: { marketing: false } as WalkerOS.Consent,\n settings: {} as Partial<Settings>,\n out: [['ttq.enableCookie'], ['ttq.disableCookie']],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACrC,QAAQ,aACL,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA;AAAA;AAAA,EAGF,aAAa,aACV,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,kBAAkB,aACf,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EAC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CAAC;AACnD;","names":["import_dev","import_dev"]}
|
package/dist/dev.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(t,a)=>{for(var n in a)e(t,n,{get:a[n],enumerable:!0})},a={};t(a,{MappingSchema:()=>d,SettingsSchema:()=>o,mapping:()=>l,settings:()=>c});import{zodToSchema as n}from"@walkeros/core/dev";import{z as i}from"@walkeros/core/dev";var o=i.object({apiKey:i.string().min(1).describe('Your TikTok Pixel ID. Find it in TikTok Ads Manager under "Assets" → "Events" → "Web Events" → select your pixel → "Setup Web Event" → "Pixel ID".'),auto_config:i.boolean().describe("TikTok default: true. Enable automatic form field detection for Advanced Matching.").optional(),limited_data_use:i.boolean().describe("TikTok default: false. Restrict data use for compliance with U.S. state privacy laws.").optional(),identify:i.unknown().describe("walkerOS mapping value resolving to an Advanced Matching object with any of: email, phone_number, external_id. All values are auto-hashed (SHA256) by the TikTok SDK before sending.").optional()});import{z as r}from"@walkeros/core/dev";var d=r.object({identify:r.unknown().describe("Per-event Advanced Matching mapping. Resolves to an object with any of: email, phone_number, external_id. Overrides destination-level settings.identify for this rule.").optional()}),c=n(o),l=n(d),s={};t(s,{env:()=>p,step:()=>g});var p={};t(p,{init:()=>v,push:()=>f,simulation:()=>b});var u=()=>{};function m(){const e=()=>{};return e.load=u,e.page=u,e.track=u,e.identify=u,e.enableCookie=u,e.disableCookie=u,e.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie"],e._i={},e.loaded=!0,e}function k(){return{window:{ttq:m()},document:{createElement:()=>({src:"",async:!1}),head:{appendChild:u}}}}var v=k(),f=k(),b=["call:ttq.load","call:ttq.track","call:ttq.identify","call:ttq.page","call:ttq.enableCookie","call:ttq.disableCookie"],g={};t(g,{consentGrantEnableCookie:()=>E,consentRevokeDisableCookie:()=>x,defaultEventForwarding:()=>h,destinationLevelIdentify:()=>T,destinationLevelInclude:()=>q,orderCompleteCompletePayment:()=>R,productViewContent:()=>w,ruleIncludeReplaces:()=>C,searchSubmitSearch:()=>A,userRegisterCompleteRegistration:()=>S,wildcardIgnored:()=>_});import{getEvent as y}from"@walkeros/core";var h={title:"Default track",description:"Without a mapping the walker event name is forwarded to ttq.track with an event_id for TikTok dedup.",in:y("product view",{id:"0123456789abcdef"}),out:[["ttq.track","product view",{},{event_id:"0123456789abcdef"}]]},_={public:!1,in:y("product view"),mapping:{ignore:!0},out:[]},w={title:"View content",description:"A product view is renamed to the TikTok ViewContent standard event with content_type, id, value, and currency.",in:y("product view",{id:"11111111aaaaaaaa"}),mapping:{name:"ViewContent",data:{map:{content_type:{value:"product"},content_id:"data.id",content_name:"data.name",content_category:"data.category",value:"data.price",currency:{key:"globals.currency",value:"EUR"}}},include:[]},out:[["ttq.track","ViewContent",{content_type:"product",content_id:"ers",content_name:"Everyday Ruck Snack",value:420,currency:"EUR"},{event_id:"11111111aaaaaaaa"}]]},q={title:"Include data",description:"Destination-level include flattens the event data section into prefixed TikTok event parameters.",in:y("product view",{id:"22222222bbbbbbbb"}),configInclude:["data"],out:[["ttq.track","product view",{data_id:"ers",data_name:"Everyday Ruck Snack",data_color:"black",data_size:"l",data_price:420},{event_id:"22222222bbbbbbbb"}]]},C={title:"Rule include overrides",description:"A per-rule include replaces the destination-level include so this event forwards only globals.",in:y("order complete",{id:"33333333cccccccc"}),configInclude:["data"],mapping:{include:["globals"]},out:[["ttq.track","order complete",{globals_pagegroup:"shop"},{event_id:"33333333cccccccc"}]]},T={title:"Advanced matching",description:"Destination-level identify calls ttq.identify with email, phone, and external id for TikTok advanced matching.",in:y("page view",{id:"44444444dddddddd",data:{email:"user@acme.com",phone:"+14135552671"}}),settings:{identify:{map:{email:"data.email",phone_number:"data.phone",external_id:"user.id"}}},out:[["ttq.identify",{email:"user@acme.com",phone_number:"+14135552671",external_id:"us3r"}],["ttq.track","page view",{},{event_id:"44444444dddddddd"}]]},S={title:"Complete registration",description:"A user register fires ttq.identify for advanced matching and then tracks CompleteRegistration.",in:y("user register",{id:"55555555eeeeeeee",data:{email:"new@acme.com",phone:"+14135551234",user_id:"new-user-123"}}),mapping:{name:"CompleteRegistration",include:[],data:{map:{content_type:{value:"product"}}},settings:{identify:{map:{email:"data.email",phone_number:"data.phone",external_id:"data.user_id"}}}},out:[["ttq.identify",{email:"new@acme.com",phone_number:"+14135551234",external_id:"new-user-123"}],["ttq.track","CompleteRegistration",{content_type:"product"},{event_id:"55555555eeeeeeee"}]]},R={title:"Complete payment",description:"A completed order is mapped to TikTok CompletePayment with value, currency, and nested product contents.",in:y("order complete",{id:"66666666ffffffff"}),mapping:{name:"CompletePayment",data:{map:{content_type:{value:"product"},value:"data.total",currency:{key:"data.currency",value:"EUR"},order_id:"data.id",contents:{loop:["nested",{map:{content_id:"data.id",content_name:"data.name",quantity:{key:"data.quantity",value:1},price:"data.price"}}]}}},include:[]},out:[["ttq.track","CompletePayment",{content_type:"product",value:555,currency:"EUR",order_id:"0rd3r1d",contents:[{content_id:"ers",content_name:"Everyday Ruck Snack",quantity:1,price:420},{content_id:"cc",content_name:"Cool Cap",quantity:1,price:42},{content_name:"Surprise",quantity:1}]},{event_id:"66666666ffffffff"}]]},A={title:"Search",description:"A search submit fires TikTok Search with the query field mapped from event data.",in:y("search submit",{id:"777777770000aaaa",data:{term:"hiking backpack"}}),mapping:{name:"Search",data:{map:{query:"data.term"}},include:[]},out:[["ttq.track","Search",{query:"hiking backpack"},{event_id:"777777770000aaaa"}]]},E={title:"Consent granted",description:"A walker consent grant for marketing calls ttq.enableCookie so TikTok can set and read its attribution cookie.",command:"consent",in:{marketing:!0},settings:{},out:[["ttq.enableCookie"]]},x={title:"Consent revoked",description:"A walker consent revoke for marketing calls ttq.disableCookie so TikTok stops using its first-party cookie.",command:"consent",in:{marketing:!1},settings:{},out:[["ttq.disableCookie"]]};export{s as examples,a as schemas};//# sourceMappingURL=dev.mjs.map
|
|
1
|
+
var e=Object.defineProperty,t=(t,a)=>{for(var n in a)e(t,n,{get:a[n],enumerable:!0})},a={};t(a,{MappingSchema:()=>d,SettingsSchema:()=>o,mapping:()=>l,settings:()=>c});import{zodToSchema as n}from"@walkeros/core/dev";import{z as i}from"@walkeros/core/dev";var o=i.object({apiKey:i.string().min(1).describe('Your TikTok Pixel ID. Find it in TikTok Ads Manager under "Assets" → "Events" → "Web Events" → select your pixel → "Setup Web Event" → "Pixel ID".'),auto_config:i.boolean().describe("TikTok default: true. Enable automatic form field detection for Advanced Matching.").optional(),limited_data_use:i.boolean().describe("TikTok default: false. Restrict data use for compliance with U.S. state privacy laws.").optional(),identify:i.unknown().describe("walkerOS mapping value resolving to an Advanced Matching object with any of: email, phone_number, external_id. All values are auto-hashed (SHA256) by the TikTok SDK before sending.").optional()});import{z as r}from"@walkeros/core/dev";var d=r.object({identify:r.unknown().describe("Per-event Advanced Matching mapping. Resolves to an object with any of: email, phone_number, external_id. Overrides destination-level settings.identify for this rule.").optional()}),c=n(o),l=n(d),s={};t(s,{env:()=>p,step:()=>g});var p={};t(p,{init:()=>v,push:()=>f,simulation:()=>b});var u=()=>{};function m(){const e=()=>{};return e.load=u,e.page=u,e.track=u,e.identify=u,e.enableCookie=u,e.disableCookie=u,e.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie"],e._i={},e.loaded=!0,e}function k(){return{window:{ttq:m()},document:{createElement:()=>({src:"",async:!1}),head:{appendChild:u}}}}var v=k(),f=k(),b=["call:ttq.load","call:ttq.track","call:ttq.identify","call:ttq.page","call:ttq.enableCookie","call:ttq.disableCookie"],g={};t(g,{consentGrantEnableCookie:()=>E,consentRevokeDisableCookie:()=>x,defaultEventForwarding:()=>h,destinationLevelIdentify:()=>T,destinationLevelInclude:()=>q,orderCompleteCompletePayment:()=>R,productViewContent:()=>w,ruleIncludeReplaces:()=>C,searchSubmitSearch:()=>A,userRegisterCompleteRegistration:()=>S,wildcardIgnored:()=>_});import{getEvent as y}from"@walkeros/core";var h={title:"Default track",description:"Without a mapping the walker event name is forwarded to ttq.track with an event_id for TikTok dedup.",in:y("product view",{id:"0123456789abcdef"}),out:[["ttq.track","product view",{},{event_id:"0123456789abcdef"}]]},_={public:!1,in:y("product view"),mapping:{ignore:!0},out:[]},w={title:"View content",description:"A product view is renamed to the TikTok ViewContent standard event with content_type, id, value, and currency.",in:y("product view",{id:"11111111aaaaaaaa"}),mapping:{name:"ViewContent",data:{map:{content_type:{value:"product"},content_id:"data.id",content_name:"data.name",content_category:"data.category",value:"data.price",currency:{key:"globals.currency",value:"EUR"}}},include:[]},out:[["ttq.track","ViewContent",{content_type:"product",content_id:"ers",content_name:"Everyday Ruck Snack",value:420,currency:"EUR"},{event_id:"11111111aaaaaaaa"}]]},q={title:"Include data",description:"Destination-level include flattens the event data section into prefixed TikTok event parameters.",in:y("product view",{id:"22222222bbbbbbbb"}),configInclude:["data"],out:[["ttq.track","product view",{data_id:"ers",data_name:"Everyday Ruck Snack",data_color:"black",data_size:"l",data_price:420},{event_id:"22222222bbbbbbbb"}]]},C={title:"Rule include overrides",description:"A per-rule include replaces the destination-level include so this event forwards only globals.",in:y("order complete",{id:"33333333cccccccc"}),configInclude:["data"],mapping:{include:["globals"]},out:[["ttq.track","order complete",{globals_pagegroup:"shop"},{event_id:"33333333cccccccc"}]]},T={title:"Advanced matching",description:"Destination-level identify calls ttq.identify with email, phone, and external id for TikTok advanced matching.",in:y("page view",{id:"44444444dddddddd",data:{email:"user@acme.com",phone:"+14135552671"}}),settings:{identify:{map:{email:"data.email",phone_number:"data.phone",external_id:"user.id"}}},out:[["ttq.identify",{email:"user@acme.com",phone_number:"+14135552671",external_id:"us3r"}],["ttq.track","page view",{},{event_id:"44444444dddddddd"}]]},S={title:"Complete registration",description:"A user register fires ttq.identify for advanced matching and then tracks CompleteRegistration.",in:y("user register",{id:"55555555eeeeeeee",data:{email:"new@acme.com",phone:"+14135551234",user_id:"new-user-123"}}),mapping:{name:"CompleteRegistration",include:[],data:{map:{content_type:{value:"product"}}},settings:{identify:{map:{email:"data.email",phone_number:"data.phone",external_id:"data.user_id"}}}},out:[["ttq.identify",{email:"new@acme.com",phone_number:"+14135551234",external_id:"new-user-123"}],["ttq.track","CompleteRegistration",{content_type:"product"},{event_id:"55555555eeeeeeee"}]]},R={title:"Complete payment",description:"A completed order is mapped to TikTok CompletePayment with value, currency, and nested product contents.",in:y("order complete",{id:"66666666ffffffff"}),mapping:{name:"CompletePayment",data:{map:{content_type:{value:"product"},value:"data.total",currency:{key:"data.currency",value:"EUR"},order_id:"data.id",contents:{loop:["nested",{map:{content_id:"data.id",content_name:"data.name",quantity:{key:"data.quantity",value:1},price:"data.price"}}]}}},include:[]},out:[["ttq.track","CompletePayment",{content_type:"product",value:555,currency:"EUR",order_id:"0rd3r1d",contents:[{content_id:"ers",content_name:"Everyday Ruck Snack",quantity:1,price:420},{content_id:"cc",content_name:"Cool Cap",quantity:1,price:42},{content_name:"Surprise",quantity:1}]},{event_id:"66666666ffffffff"}]]},A={title:"Search",description:"A search submit fires TikTok Search with the query field mapped from event data.",in:y("search submit",{id:"777777770000aaaa",data:{term:"hiking backpack"}}),mapping:{name:"Search",data:{map:{query:"data.term"}},include:[]},out:[["ttq.track","Search",{query:"hiking backpack"},{event_id:"777777770000aaaa"}]]},E={title:"Consent granted",description:"A walker consent grant for marketing calls ttq.enableCookie so TikTok can set and read its attribution cookie.",command:"consent",in:{marketing:!0},settings:{},out:[["ttq.enableCookie"]]},x={title:"Consent revoked",description:"A walker consent revoke for marketing calls ttq.disableCookie so TikTok stops using its first-party cookie.",command:"consent",before:{marketing:!0},in:{marketing:!1},settings:{},out:[["ttq.enableCookie"],["ttq.disableCookie"]]};export{s as examples,a as schemas};//# sourceMappingURL=dev.mjs.map
|
package/dist/dev.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n apiKey: z\n .string()\n .min(1)\n .describe(\n 'Your TikTok Pixel ID. Find it in TikTok Ads Manager under \"Assets\" → \"Events\" → \"Web Events\" → select your pixel → \"Setup Web Event\" → \"Pixel ID\".',\n ),\n // `pageview` removed 2026-04-09 — TikTok's SDK fires auto page view and\n // the knob was unreliable. Let it fire; don't expose a toggle.\n auto_config: z\n .boolean()\n .describe(\n 'TikTok default: true. Enable automatic form field detection for Advanced Matching.',\n )\n .optional(),\n limited_data_use: z\n .boolean()\n .describe(\n 'TikTok default: false. Restrict data use for compliance with U.S. state privacy laws.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to an Advanced Matching object with any of: email, phone_number, external_id. All values are auto-hashed (SHA256) by the TikTok SDK before sending.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event Advanced Matching mapping. Resolves to an object with any of: email, phone_number, external_id. Overrides destination-level settings.identify for this rule.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, TTQ } from '../types';\n\nconst noop = () => {};\n\n/** Build a fresh mock ttq — each call returns a new object so tests can mutate independently. */\nfunction makeMockTTQ(): TTQ {\n const fn = (() => {}) as unknown as TTQ;\n fn.load = noop;\n fn.page = noop;\n fn.track = noop;\n fn.identify = noop;\n fn.enableCookie = noop;\n fn.disableCookie = noop;\n fn.methods = [\n 'page',\n 'track',\n 'identify',\n 'instances',\n 'debug',\n 'on',\n 'off',\n 'once',\n 'ready',\n 'alias',\n 'group',\n 'enableCookie',\n 'disableCookie',\n ];\n fn._i = {};\n fn.loaded = true;\n return fn;\n}\n\n/**\n * Minimal web env — window has a mock ttq. document has the bare minimum\n * for addScript() (createElement + head.appendChild), with no-op\n * implementations so init() can run without a real DOM.\n */\nfunction makeEnv(): Env {\n return {\n window: {\n ttq: makeMockTTQ(),\n },\n document: {\n createElement: () =>\n ({\n src: '',\n async: false,\n }) as unknown as Element,\n head: { appendChild: noop },\n },\n };\n}\n\n/**\n * Pre-init env — destination init() call will set up ttq and load the\n * script. Tests receive this as a starting point.\n */\nexport const init: Env = makeEnv();\n\n/**\n * Post-init env — same shape; the test runner clones this and replaces\n * individual ttq methods with jest.fn() so it can assert on calls.\n */\nexport const push: Env = makeEnv();\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = [\n 'call:ttq.load',\n 'call:ttq.track',\n 'call:ttq.identify',\n 'call:ttq.page',\n 'call:ttq.enableCookie',\n 'call:ttq.disableCookie',\n];\n","import type { Flow, WalkerOS } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Examples may optionally carry destination-level settings. The test\n * runner reads `settings` from the example and merges it into the base\n * destination settings on top of the fixed apiKey.\n */\nexport type TikTokStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n configInclude?: string[];\n};\n\n/**\n * Default event forwarding - every walkerOS event becomes a ttq.track()\n * call. With no mapping and no destination-level include, the params\n * object is empty. event_id is always passed as the 3rd argument (TikTok\n * dedup between pixel and Events API).\n *\n * NOTE: The raw walkerOS event name \"product view\" (with space) is NOT a\n * TikTok standard event. Without a mapping.name override, TikTok treats\n * it as a custom event - functional for audience building, no\n * optimization. The next example shows the recommended override.\n */\nexport const defaultEventForwarding: TikTokStepExample = {\n title: 'Default track',\n description:\n 'Without a mapping the walker event name is forwarded to ttq.track with an event_id for TikTok dedup.',\n in: getEvent('product view', { id: '0123456789abcdef' }),\n out: [['ttq.track', 'product view', {}, { event_id: '0123456789abcdef' }]],\n};\n\n/**\n * Wildcard ignore - walkerOS's standard way to drop events. The rule\n * matches but does nothing. The destination fires zero SDK calls.\n */\nexport const wildcardIgnored: TikTokStepExample = {\n public: false,\n in: getEvent('product view'),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * The canonical TikTok pattern: walkerOS \"product view\" → TikTok\n * \"ViewContent\" via mapping.name. mapping.data builds the TikTok-native\n * parameter shape (content_type, content_id, content_name, value,\n * currency). include is explicitly set to [] so prefixed walkerOS\n * properties don't leak onto the call and confuse TikTok's matcher.\n */\nexport const productViewContent: TikTokStepExample = {\n title: 'View content',\n description:\n 'A product view is renamed to the TikTok ViewContent standard event with content_type, id, value, and currency.',\n in: getEvent('product view', { id: '11111111aaaaaaaa' }),\n mapping: {\n name: 'ViewContent',\n data: {\n map: {\n content_type: { value: 'product' },\n content_id: 'data.id',\n content_name: 'data.name',\n content_category: 'data.category',\n value: 'data.price',\n currency: { key: 'globals.currency', value: 'EUR' },\n },\n },\n include: [],\n },\n out: [\n [\n 'ttq.track',\n 'ViewContent',\n {\n content_type: 'product',\n content_id: 'ers',\n content_name: 'Everyday Ruck Snack',\n // content_category is absent from the default product view fixture;\n // the mapper skips undefined resolutions.\n value: 420,\n currency: 'EUR', // fallback - default fixture has no globals.currency\n },\n { event_id: '11111111aaaaaaaa' },\n ],\n ],\n};\n\n/**\n * Destination-level settings.include flattens the walkerOS `data` section\n * into prefixed TikTok event parameters on every push. This is the\n * \"dump everything\" mode - useful for custom events where TikTok won't\n * do optimization anyway, and no mapping.data is needed.\n */\nexport const destinationLevelInclude: TikTokStepExample = {\n title: 'Include data',\n description:\n 'Destination-level include flattens the event data section into prefixed TikTok event parameters.',\n in: getEvent('product view', { id: '22222222bbbbbbbb' }),\n configInclude: ['data'],\n out: [\n [\n 'ttq.track',\n 'product view',\n {\n data_id: 'ers',\n data_name: 'Everyday Ruck Snack',\n data_color: 'black',\n data_size: 'l',\n data_price: 420,\n },\n { event_id: '22222222bbbbbbbb' },\n ],\n ],\n};\n\n/**\n * Per-rule settings.include REPLACES destination-level include for the\n * matched rule (design doc §6: mapping-level include replaces, not\n * merges with, destination-level include).\n */\nexport const ruleIncludeReplaces: TikTokStepExample = {\n title: 'Rule include overrides',\n description:\n 'A per-rule include replaces the destination-level include so this event forwards only globals.',\n in: getEvent('order complete', { id: '33333333cccccccc' }),\n configInclude: ['data'],\n mapping: {\n include: ['globals'],\n },\n out: [\n [\n 'ttq.track',\n 'order complete',\n {\n globals_pagegroup: 'shop',\n },\n { event_id: '33333333cccccccc' },\n ],\n ],\n};\n\n/**\n * Destination-level settings.identify fires on the first push (once the\n * state cache is empty). Advanced Matching parameters (email,\n * phone_number, external_id) are passed to ttq.identify() which\n * auto-hashes them SHA256 before sending. Subsequent pushes with\n * unchanged values do NOT re-fire ttq.identify() - runtime state tracks\n * the last-resolved identity.\n *\n * walkerOS's default user fixture has user.id='us3r' and no email/phone,\n * so the example injects data and maps from there.\n */\nexport const destinationLevelIdentify: TikTokStepExample = {\n title: 'Advanced matching',\n description:\n 'Destination-level identify calls ttq.identify with email, phone, and external id for TikTok advanced matching.',\n in: getEvent('page view', {\n id: '44444444dddddddd',\n data: {\n email: 'user@acme.com',\n phone: '+14135552671',\n },\n }),\n settings: {\n identify: {\n map: {\n email: 'data.email',\n phone_number: 'data.phone',\n external_id: 'user.id',\n },\n },\n },\n out: [\n [\n 'ttq.identify',\n {\n email: 'user@acme.com',\n phone_number: '+14135552671',\n external_id: 'us3r',\n },\n ],\n ['ttq.track', 'page view', {}, { event_id: '44444444dddddddd' }],\n ],\n};\n\n/**\n * User registration → CompleteRegistration standard event with per-event\n * identify. The user just provided their email + phone, so this is the\n * moment to fire Advanced Matching for this session. The per-event\n * identify overrides any destination-level identify for this one push.\n */\nexport const userRegisterCompleteRegistration: TikTokStepExample = {\n title: 'Complete registration',\n description:\n 'A user register fires ttq.identify for advanced matching and then tracks CompleteRegistration.',\n in: getEvent('user register', {\n id: '55555555eeeeeeee',\n data: {\n email: 'new@acme.com',\n phone: '+14135551234',\n user_id: 'new-user-123',\n },\n }),\n mapping: {\n name: 'CompleteRegistration',\n include: [],\n data: {\n map: {\n content_type: { value: 'product' },\n },\n },\n settings: {\n identify: {\n map: {\n email: 'data.email',\n phone_number: 'data.phone',\n external_id: 'data.user_id',\n },\n },\n },\n },\n out: [\n [\n 'ttq.identify',\n {\n email: 'new@acme.com',\n phone_number: '+14135551234',\n external_id: 'new-user-123',\n },\n ],\n [\n 'ttq.track',\n 'CompleteRegistration',\n {\n content_type: 'product',\n },\n { event_id: '55555555eeeeeeee' },\n ],\n ],\n};\n\n/**\n * Multi-product order → CompletePayment standard event. The canonical\n * TikTok ecommerce pattern:\n * - mapping.name flips the walkerOS event to TikTok's rigid taxonomy\n * - mapping.data builds the TikTok-native parameter shape\n * - loop iterates event.nested to produce the `contents` array, one\n * entry per product\n * - { key, value: 'EUR' } provides a currency fallback if data.currency\n * is absent (here data.currency is 'EUR' so the key wins)\n *\n * The default \"order complete\" fixture has 3 nested entries: two\n * products (ers, cc) and one gift (Surprise - no id, no price).\n */\nexport const orderCompleteCompletePayment: TikTokStepExample = {\n title: 'Complete payment',\n description:\n 'A completed order is mapped to TikTok CompletePayment with value, currency, and nested product contents.',\n in: getEvent('order complete', { id: '66666666ffffffff' }),\n mapping: {\n name: 'CompletePayment',\n data: {\n map: {\n content_type: { value: 'product' },\n value: 'data.total',\n currency: { key: 'data.currency', value: 'EUR' },\n order_id: 'data.id',\n contents: {\n loop: [\n 'nested',\n {\n map: {\n content_id: 'data.id',\n content_name: 'data.name',\n quantity: { key: 'data.quantity', value: 1 },\n price: 'data.price',\n },\n },\n ],\n },\n },\n },\n include: [],\n },\n out: [\n [\n 'ttq.track',\n 'CompletePayment',\n {\n content_type: 'product',\n value: 555,\n currency: 'EUR',\n order_id: '0rd3r1d',\n contents: [\n {\n content_id: 'ers',\n content_name: 'Everyday Ruck Snack',\n quantity: 1, // fallback - fixture has no data.quantity\n price: 420,\n },\n {\n content_id: 'cc',\n content_name: 'Cool Cap',\n quantity: 1,\n price: 42,\n },\n {\n // gift entry - { name: 'Surprise' }, no id and no price.\n // walkerOS map skips keys whose resolved value is undefined.\n content_name: 'Surprise',\n quantity: 1,\n },\n ],\n },\n { event_id: '66666666ffffffff' },\n ],\n ],\n};\n\n/**\n * Search → TikTok Search standard event. Minimal example that shows how\n * a walkerOS search event flips through mapping.name with a single\n * mapping.data field (the query string).\n */\nexport const searchSubmitSearch: TikTokStepExample = {\n title: 'Search',\n description:\n 'A search submit fires TikTok Search with the query field mapped from event data.',\n in: getEvent('search submit', {\n id: '777777770000aaaa',\n data: {\n term: 'hiking backpack',\n },\n }),\n mapping: {\n name: 'Search',\n data: {\n map: {\n query: 'data.term',\n },\n },\n include: [],\n },\n out: [\n [\n 'ttq.track',\n 'Search',\n {\n query: 'hiking backpack',\n },\n { event_id: '777777770000aaaa' },\n ],\n ],\n};\n\n/**\n * Consent granted → ttq.enableCookie(). The destination checks the\n * consent keys declared in config.consent (here \"marketing\" - TikTok is\n * an ad platform, not analytics) and toggles cookie behavior.\n *\n * Uses the canonical StepExample.command='consent' pattern: the test\n * runner dispatches via elb('walker consent', in) instead of pushing\n * an event.\n */\nexport const consentGrantEnableCookie: TikTokStepExample = {\n title: 'Consent granted',\n description:\n 'A walker consent grant for marketing calls ttq.enableCookie so TikTok can set and read its attribution cookie.',\n command: 'consent',\n in: { marketing: true } as WalkerOS.Consent,\n settings: {} as Partial<Settings>, // consent key is derived from config.consent\n out: [['ttq.enableCookie']],\n};\n\n/**\n * Consent revoked → ttq.disableCookie(). TikTok stops setting and\n * reading its first-party cookie (_ttp) for attribution.\n */\nexport const consentRevokeDisableCookie: TikTokStepExample = {\n title: 'Consent revoked',\n description:\n 'A walker consent revoke for marketing calls ttq.disableCookie so TikTok stops using its first-party cookie.',\n command: 'consent',\n in: { marketing: false } as WalkerOS.Consent,\n settings: {} as Partial<Settings>,\n out: [['ttq.disable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AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,KAAK;AAAA,EACtB,UAAU,CAAC;AAAA;AAAA,EACX,KAAK,CAAC,CAAC,kBAAkB,CAAC;AAC5B;AAMO,IAAM,6BAAgD;AAAA,EAC3D,OAAO;AAAA,EACP,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,MAAM;AAAA,EACvB,UAAU,CAAC;AAAA,EACX,KAAK,CAAC,CAAC,mBAAmB,CAAC;AAC7B;","names":["z"]}
|
|
1
|
+
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n apiKey: z\n .string()\n .min(1)\n .describe(\n 'Your TikTok Pixel ID. Find it in TikTok Ads Manager under \"Assets\" → \"Events\" → \"Web Events\" → select your pixel → \"Setup Web Event\" → \"Pixel ID\".',\n ),\n // `pageview` removed 2026-04-09 — TikTok's SDK fires auto page view and\n // the knob was unreliable. Let it fire; don't expose a toggle.\n auto_config: z\n .boolean()\n .describe(\n 'TikTok default: true. Enable automatic form field detection for Advanced Matching.',\n )\n .optional(),\n limited_data_use: z\n .boolean()\n .describe(\n 'TikTok default: false. Restrict data use for compliance with U.S. state privacy laws.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to an Advanced Matching object with any of: email, phone_number, external_id. All values are auto-hashed (SHA256) by the TikTok SDK before sending.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event Advanced Matching mapping. Resolves to an object with any of: email, phone_number, external_id. Overrides destination-level settings.identify for this rule.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, TTQ } from '../types';\n\nconst noop = () => {};\n\n/** Build a fresh mock ttq — each call returns a new object so tests can mutate independently. */\nfunction makeMockTTQ(): TTQ {\n const fn = (() => {}) as unknown as TTQ;\n fn.load = noop;\n fn.page = noop;\n fn.track = noop;\n fn.identify = noop;\n fn.enableCookie = noop;\n fn.disableCookie = noop;\n fn.methods = [\n 'page',\n 'track',\n 'identify',\n 'instances',\n 'debug',\n 'on',\n 'off',\n 'once',\n 'ready',\n 'alias',\n 'group',\n 'enableCookie',\n 'disableCookie',\n ];\n fn._i = {};\n fn.loaded = true;\n return fn;\n}\n\n/**\n * Minimal web env — window has a mock ttq. document has the bare minimum\n * for addScript() (createElement + head.appendChild), with no-op\n * implementations so init() can run without a real DOM.\n */\nfunction makeEnv(): Env {\n return {\n window: {\n ttq: makeMockTTQ(),\n },\n document: {\n createElement: () =>\n ({\n src: '',\n async: false,\n }) as unknown as Element,\n head: { appendChild: noop },\n },\n };\n}\n\n/**\n * Pre-init env — destination init() call will set up ttq and load the\n * script. Tests receive this as a starting point.\n */\nexport const init: Env = makeEnv();\n\n/**\n * Post-init env — same shape; the test runner clones this and replaces\n * individual ttq methods with jest.fn() so it can assert on calls.\n */\nexport const push: Env = makeEnv();\n\n/** Simulation tracking paths for CLI --simulate. */\nexport const simulation = [\n 'call:ttq.load',\n 'call:ttq.track',\n 'call:ttq.identify',\n 'call:ttq.page',\n 'call:ttq.enableCookie',\n 'call:ttq.disableCookie',\n];\n","import type { Flow, WalkerOS } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Examples may optionally carry destination-level settings. The test\n * runner reads `settings` from the example and merges it into the base\n * destination settings on top of the fixed apiKey.\n */\nexport type TikTokStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n configInclude?: string[];\n /** Consent granted before `in` so a gated destination is loaded first. */\n before?: WalkerOS.Consent;\n};\n\n/**\n * Default event forwarding - every walkerOS event becomes a ttq.track()\n * call. With no mapping and no destination-level include, the params\n * object is empty. event_id is always passed as the 3rd argument (TikTok\n * dedup between pixel and Events API).\n *\n * NOTE: The raw walkerOS event name \"product view\" (with space) is NOT a\n * TikTok standard event. Without a mapping.name override, TikTok treats\n * it as a custom event - functional for audience building, no\n * optimization. The next example shows the recommended override.\n */\nexport const defaultEventForwarding: TikTokStepExample = {\n title: 'Default track',\n description:\n 'Without a mapping the walker event name is forwarded to ttq.track with an event_id for TikTok dedup.',\n in: getEvent('product view', { id: '0123456789abcdef' }),\n out: [['ttq.track', 'product view', {}, { event_id: '0123456789abcdef' }]],\n};\n\n/**\n * Wildcard ignore - walkerOS's standard way to drop events. The rule\n * matches but does nothing. The destination fires zero SDK calls.\n */\nexport const wildcardIgnored: TikTokStepExample = {\n public: false,\n in: getEvent('product view'),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * The canonical TikTok pattern: walkerOS \"product view\" → TikTok\n * \"ViewContent\" via mapping.name. mapping.data builds the TikTok-native\n * parameter shape (content_type, content_id, content_name, value,\n * currency). include is explicitly set to [] so prefixed walkerOS\n * properties don't leak onto the call and confuse TikTok's matcher.\n */\nexport const productViewContent: TikTokStepExample = {\n title: 'View content',\n description:\n 'A product view is renamed to the TikTok ViewContent standard event with content_type, id, value, and currency.',\n in: getEvent('product view', { id: '11111111aaaaaaaa' }),\n mapping: {\n name: 'ViewContent',\n data: {\n map: {\n content_type: { value: 'product' },\n content_id: 'data.id',\n content_name: 'data.name',\n content_category: 'data.category',\n value: 'data.price',\n currency: { key: 'globals.currency', value: 'EUR' },\n },\n },\n include: [],\n },\n out: [\n [\n 'ttq.track',\n 'ViewContent',\n {\n content_type: 'product',\n content_id: 'ers',\n content_name: 'Everyday Ruck Snack',\n // content_category is absent from the default product view fixture;\n // the mapper skips undefined resolutions.\n value: 420,\n currency: 'EUR', // fallback - default fixture has no globals.currency\n },\n { event_id: '11111111aaaaaaaa' },\n ],\n ],\n};\n\n/**\n * Destination-level settings.include flattens the walkerOS `data` section\n * into prefixed TikTok event parameters on every push. This is the\n * \"dump everything\" mode - useful for custom events where TikTok won't\n * do optimization anyway, and no mapping.data is needed.\n */\nexport const destinationLevelInclude: TikTokStepExample = {\n title: 'Include data',\n description:\n 'Destination-level include flattens the event data section into prefixed TikTok event parameters.',\n in: getEvent('product view', { id: '22222222bbbbbbbb' }),\n configInclude: ['data'],\n out: [\n [\n 'ttq.track',\n 'product view',\n {\n data_id: 'ers',\n data_name: 'Everyday Ruck Snack',\n data_color: 'black',\n data_size: 'l',\n data_price: 420,\n },\n { event_id: '22222222bbbbbbbb' },\n ],\n ],\n};\n\n/**\n * Per-rule settings.include REPLACES destination-level include for the\n * matched rule (design doc §6: mapping-level include replaces, not\n * merges with, destination-level include).\n */\nexport const ruleIncludeReplaces: TikTokStepExample = {\n title: 'Rule include overrides',\n description:\n 'A per-rule include replaces the destination-level include so this event forwards only globals.',\n in: getEvent('order complete', { id: '33333333cccccccc' }),\n configInclude: ['data'],\n mapping: {\n include: ['globals'],\n },\n out: [\n [\n 'ttq.track',\n 'order complete',\n {\n globals_pagegroup: 'shop',\n },\n { event_id: '33333333cccccccc' },\n ],\n ],\n};\n\n/**\n * Destination-level settings.identify fires on the first push (once the\n * state cache is empty). Advanced Matching parameters (email,\n * phone_number, external_id) are passed to ttq.identify() which\n * auto-hashes them SHA256 before sending. Subsequent pushes with\n * unchanged values do NOT re-fire ttq.identify() - runtime state tracks\n * the last-resolved identity.\n *\n * walkerOS's default user fixture has user.id='us3r' and no email/phone,\n * so the example injects data and maps from there.\n */\nexport const destinationLevelIdentify: TikTokStepExample = {\n title: 'Advanced matching',\n description:\n 'Destination-level identify calls ttq.identify with email, phone, and external id for TikTok advanced matching.',\n in: getEvent('page view', {\n id: '44444444dddddddd',\n data: {\n email: 'user@acme.com',\n phone: '+14135552671',\n },\n }),\n settings: {\n identify: {\n map: {\n email: 'data.email',\n phone_number: 'data.phone',\n external_id: 'user.id',\n },\n },\n },\n out: [\n [\n 'ttq.identify',\n {\n email: 'user@acme.com',\n phone_number: '+14135552671',\n external_id: 'us3r',\n },\n ],\n ['ttq.track', 'page view', {}, { event_id: '44444444dddddddd' }],\n ],\n};\n\n/**\n * User registration → CompleteRegistration standard event with per-event\n * identify. The user just provided their email + phone, so this is the\n * moment to fire Advanced Matching for this session. The per-event\n * identify overrides any destination-level identify for this one push.\n */\nexport const userRegisterCompleteRegistration: TikTokStepExample = {\n title: 'Complete registration',\n description:\n 'A user register fires ttq.identify for advanced matching and then tracks CompleteRegistration.',\n in: getEvent('user register', {\n id: '55555555eeeeeeee',\n data: {\n email: 'new@acme.com',\n phone: '+14135551234',\n user_id: 'new-user-123',\n },\n }),\n mapping: {\n name: 'CompleteRegistration',\n include: [],\n data: {\n map: {\n content_type: { value: 'product' },\n },\n },\n settings: {\n identify: {\n map: {\n email: 'data.email',\n phone_number: 'data.phone',\n external_id: 'data.user_id',\n },\n },\n },\n },\n out: [\n [\n 'ttq.identify',\n {\n email: 'new@acme.com',\n phone_number: '+14135551234',\n external_id: 'new-user-123',\n },\n ],\n [\n 'ttq.track',\n 'CompleteRegistration',\n {\n content_type: 'product',\n },\n { event_id: '55555555eeeeeeee' },\n ],\n ],\n};\n\n/**\n * Multi-product order → CompletePayment standard event. The canonical\n * TikTok ecommerce pattern:\n * - mapping.name flips the walkerOS event to TikTok's rigid taxonomy\n * - mapping.data builds the TikTok-native parameter shape\n * - loop iterates event.nested to produce the `contents` array, one\n * entry per product\n * - { key, value: 'EUR' } provides a currency fallback if data.currency\n * is absent (here data.currency is 'EUR' so the key wins)\n *\n * The default \"order complete\" fixture has 3 nested entries: two\n * products (ers, cc) and one gift (Surprise - no id, no price).\n */\nexport const orderCompleteCompletePayment: TikTokStepExample = {\n title: 'Complete payment',\n description:\n 'A completed order is mapped to TikTok CompletePayment with value, currency, and nested product contents.',\n in: getEvent('order complete', { id: '66666666ffffffff' }),\n mapping: {\n name: 'CompletePayment',\n data: {\n map: {\n content_type: { value: 'product' },\n value: 'data.total',\n currency: { key: 'data.currency', value: 'EUR' },\n order_id: 'data.id',\n contents: {\n loop: [\n 'nested',\n {\n map: {\n content_id: 'data.id',\n content_name: 'data.name',\n quantity: { key: 'data.quantity', value: 1 },\n price: 'data.price',\n },\n },\n ],\n },\n },\n },\n include: [],\n },\n out: [\n [\n 'ttq.track',\n 'CompletePayment',\n {\n content_type: 'product',\n value: 555,\n currency: 'EUR',\n order_id: '0rd3r1d',\n contents: [\n {\n content_id: 'ers',\n content_name: 'Everyday Ruck Snack',\n quantity: 1, // fallback - fixture has no data.quantity\n price: 420,\n },\n {\n content_id: 'cc',\n content_name: 'Cool Cap',\n quantity: 1,\n price: 42,\n },\n {\n // gift entry - { name: 'Surprise' }, no id and no price.\n // walkerOS map skips keys whose resolved value is undefined.\n content_name: 'Surprise',\n quantity: 1,\n },\n ],\n },\n { event_id: '66666666ffffffff' },\n ],\n ],\n};\n\n/**\n * Search → TikTok Search standard event. Minimal example that shows how\n * a walkerOS search event flips through mapping.name with a single\n * mapping.data field (the query string).\n */\nexport const searchSubmitSearch: TikTokStepExample = {\n title: 'Search',\n description:\n 'A search submit fires TikTok Search with the query field mapped from event data.',\n in: getEvent('search submit', {\n id: '777777770000aaaa',\n data: {\n term: 'hiking backpack',\n },\n }),\n mapping: {\n name: 'Search',\n data: {\n map: {\n query: 'data.term',\n },\n },\n include: [],\n },\n out: [\n [\n 'ttq.track',\n 'Search',\n {\n query: 'hiking backpack',\n },\n { event_id: '777777770000aaaa' },\n ],\n ],\n};\n\n/**\n * Consent granted → ttq.enableCookie(). The destination checks the\n * consent keys declared in config.consent (here \"marketing\" - TikTok is\n * an ad platform, not analytics) and toggles cookie behavior.\n *\n * Uses the canonical StepExample.command='consent' pattern: the test\n * runner dispatches via elb('walker consent', in) instead of pushing\n * an event.\n */\nexport const consentGrantEnableCookie: TikTokStepExample = {\n title: 'Consent granted',\n description:\n 'A walker consent grant for marketing calls ttq.enableCookie so TikTok can set and read its attribution cookie.',\n command: 'consent',\n in: { marketing: true } as WalkerOS.Consent,\n settings: {} as Partial<Settings>, // consent key is derived from config.consent\n out: [['ttq.enableCookie']],\n};\n\n/**\n * Consent revoked → ttq.disableCookie(). TikTok stops setting and\n * reading its first-party cookie (_ttp) for attribution.\n */\nexport const consentRevokeDisableCookie: TikTokStepExample = {\n title: 'Consent revoked',\n description:\n 'A walker consent revoke for marketing calls ttq.disableCookie so TikTok stops using its first-party cookie.',\n command: 'consent',\n before: { marketing: true },\n in: { marketing: false } as WalkerOS.Consent,\n settings: {} as Partial<Settings>,\n out: [['ttq.enableCookie'], ['ttq.disableCookie']],\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,QAAQ,EACL,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA;AAAA;AAAA,EAGF,aAAa,EACV,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,kBAAkB,EACf,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,EACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AC7BD,SAAS,KAAAA,UAAS;AAEX,IAAM,gBAAgBA,GAAE,OAAO;AAAA,EACpC,UAAUA,GACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AFDM,IAAM,WAAW,YAAY,cAAc;AAC3C,IAAM,UAAU,YAAY,aAAa;;;AGThD;AAAA;AAAA;AAAA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,UAAU,mBAAmB;AAAA,IACjC;AAAA,EACF;AACF;AAOO,IAAM,qBAAwC;AAAA,EACnD,OAAO;AAAA,EACP,aACE;AAAA,EACF,IAAI,SAAS,iBAAiB;AAAA,IAC5B,IAAI;AAAA,IACJ,MAAM;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,EACF,CAAC;AAAA,EACD,SAAS;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,MACJ,KAAK;AAAA,QACH,OAAO;AAAA,MACT;AAAA,IACF;AAAA,IACA,SAAS,CAAC;AAAA,EACZ;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,QACE,OAAO;AAAA,MACT;AAAA,MACA,EAAE,UAAU,mBAAmB;AAAA,IACjC;AAAA,EACF;AACF;AAWO,IAAM,2BAA8C;AAAA,EACzD,OAAO;AAAA,EACP,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,KAAK;AAAA,EACtB,UAAU,CAAC;AAAA;AAAA,EACX,KAAK,CAAC,CAAC,kBAAkB,CAAC;AAC5B;AAMO,IAAM,6BAAgD;AAAA,EAC3D,OAAO;AAAA,EACP,aACE;AAAA,EACF,SAAS;AAAA,EACT,QAAQ,EAAE,WAAW,KAAK;AAAA,EAC1B,IAAI,EAAE,WAAW,MAAM;AAAA,EACvB,UAAU,CAAC;AAAA,EACX,KAAK,CAAC,CAAC,kBAAkB,GAAG,CAAC,mBAAmB,CAAC;AACnD;","names":["z"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mapping, Flow } from '@walkeros/core';
|
|
1
|
+
import { Mapping, Flow, WalkerOS } from '@walkeros/core';
|
|
2
2
|
import { DestinationWeb } from '@walkeros/web-core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -120,6 +120,8 @@ declare namespace env {
|
|
|
120
120
|
type TikTokStepExample = Flow.StepExample & {
|
|
121
121
|
settings?: Partial<Settings>;
|
|
122
122
|
configInclude?: string[];
|
|
123
|
+
/** Consent granted before `in` so a gated destination is loaded first. */
|
|
124
|
+
before?: WalkerOS.Consent;
|
|
123
125
|
};
|
|
124
126
|
/**
|
|
125
127
|
* Default event forwarding - every walkerOS event becomes a ttq.track()
|
package/dist/examples/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mapping, Flow } from '@walkeros/core';
|
|
1
|
+
import { Mapping, Flow, WalkerOS } from '@walkeros/core';
|
|
2
2
|
import { DestinationWeb } from '@walkeros/web-core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -120,6 +120,8 @@ declare namespace env {
|
|
|
120
120
|
type TikTokStepExample = Flow.StepExample & {
|
|
121
121
|
settings?: Partial<Settings>;
|
|
122
122
|
configInclude?: string[];
|
|
123
|
+
/** Consent granted before `in` so a gated destination is loaded first. */
|
|
124
|
+
before?: WalkerOS.Consent;
|
|
123
125
|
};
|
|
124
126
|
/**
|
|
125
127
|
* Default event forwarding - every walkerOS event becomes a ttq.track()
|
package/dist/examples/index.js
CHANGED
|
@@ -375,9 +375,10 @@ var consentRevokeDisableCookie = {
|
|
|
375
375
|
title: "Consent revoked",
|
|
376
376
|
description: "A walker consent revoke for marketing calls ttq.disableCookie so TikTok stops using its first-party cookie.",
|
|
377
377
|
command: "consent",
|
|
378
|
+
before: { marketing: true },
|
|
378
379
|
in: { marketing: false },
|
|
379
380
|
settings: {},
|
|
380
|
-
out: [["ttq.disableCookie"]]
|
|
381
|
+
out: [["ttq.enableCookie"], ["ttq.disableCookie"]]
|
|
381
382
|
};
|
|
382
383
|
// Annotate the CommonJS export names for ESM import in node:
|
|
383
384
|
0 && (module.exports = {
|
package/dist/examples/index.mjs
CHANGED
|
@@ -354,9 +354,10 @@ var consentRevokeDisableCookie = {
|
|
|
354
354
|
title: "Consent revoked",
|
|
355
355
|
description: "A walker consent revoke for marketing calls ttq.disableCookie so TikTok stops using its first-party cookie.",
|
|
356
356
|
command: "consent",
|
|
357
|
+
before: { marketing: true },
|
|
357
358
|
in: { marketing: false },
|
|
358
359
|
settings: {},
|
|
359
|
-
out: [["ttq.disableCookie"]]
|
|
360
|
+
out: [["ttq.enableCookie"], ["ttq.disableCookie"]]
|
|
360
361
|
};
|
|
361
362
|
export {
|
|
362
363
|
env_exports as env,
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/web-destination-tiktok",
|
|
4
|
-
"version": "4.2.
|
|
4
|
+
"version": "4.2.1-next-1781538735002",
|
|
5
5
|
"type": "destination",
|
|
6
6
|
"platform": [
|
|
7
7
|
"web"
|
|
@@ -111,11 +111,17 @@
|
|
|
111
111
|
"title": "Consent revoked",
|
|
112
112
|
"description": "A walker consent revoke for marketing calls ttq.disableCookie so TikTok stops using its first-party cookie.",
|
|
113
113
|
"command": "consent",
|
|
114
|
+
"before": {
|
|
115
|
+
"marketing": true
|
|
116
|
+
},
|
|
114
117
|
"in": {
|
|
115
118
|
"marketing": false
|
|
116
119
|
},
|
|
117
120
|
"settings": {},
|
|
118
121
|
"out": [
|
|
122
|
+
[
|
|
123
|
+
"ttq.enableCookie"
|
|
124
|
+
],
|
|
119
125
|
[
|
|
120
126
|
"ttq.disableCookie"
|
|
121
127
|
]
|
|
@@ -158,7 +164,7 @@
|
|
|
158
164
|
"trigger": "load",
|
|
159
165
|
"entity": "product",
|
|
160
166
|
"action": "view",
|
|
161
|
-
"timestamp":
|
|
167
|
+
"timestamp": 1781482417000,
|
|
162
168
|
"timing": 3.14,
|
|
163
169
|
"source": {
|
|
164
170
|
"type": "collector",
|
|
@@ -217,7 +223,7 @@
|
|
|
217
223
|
"trigger": "load",
|
|
218
224
|
"entity": "page",
|
|
219
225
|
"action": "view",
|
|
220
|
-
"timestamp":
|
|
226
|
+
"timestamp": 1781482417000,
|
|
221
227
|
"timing": 3.14,
|
|
222
228
|
"source": {
|
|
223
229
|
"type": "collector",
|
|
@@ -289,7 +295,7 @@
|
|
|
289
295
|
"trigger": "load",
|
|
290
296
|
"entity": "product",
|
|
291
297
|
"action": "view",
|
|
292
|
-
"timestamp":
|
|
298
|
+
"timestamp": 1781482417000,
|
|
293
299
|
"timing": 3.14,
|
|
294
300
|
"source": {
|
|
295
301
|
"type": "collector",
|
|
@@ -400,7 +406,7 @@
|
|
|
400
406
|
"trigger": "load",
|
|
401
407
|
"entity": "order",
|
|
402
408
|
"action": "complete",
|
|
403
|
-
"timestamp":
|
|
409
|
+
"timestamp": 1781482417000,
|
|
404
410
|
"timing": 3.14,
|
|
405
411
|
"source": {
|
|
406
412
|
"type": "collector",
|
|
@@ -511,7 +517,7 @@
|
|
|
511
517
|
"trigger": "load",
|
|
512
518
|
"entity": "product",
|
|
513
519
|
"action": "view",
|
|
514
|
-
"timestamp":
|
|
520
|
+
"timestamp": 1781482417000,
|
|
515
521
|
"timing": 3.14,
|
|
516
522
|
"source": {
|
|
517
523
|
"type": "collector",
|
|
@@ -638,7 +644,7 @@
|
|
|
638
644
|
"trigger": "load",
|
|
639
645
|
"entity": "order",
|
|
640
646
|
"action": "complete",
|
|
641
|
-
"timestamp":
|
|
647
|
+
"timestamp": 1781482417000,
|
|
642
648
|
"timing": 3.14,
|
|
643
649
|
"source": {
|
|
644
650
|
"type": "collector",
|
|
@@ -706,7 +712,7 @@
|
|
|
706
712
|
"trigger": "test",
|
|
707
713
|
"entity": "search",
|
|
708
714
|
"action": "submit",
|
|
709
|
-
"timestamp":
|
|
715
|
+
"timestamp": 1781482417000,
|
|
710
716
|
"timing": 3.14,
|
|
711
717
|
"source": {
|
|
712
718
|
"type": "collector",
|
|
@@ -777,7 +783,7 @@
|
|
|
777
783
|
"trigger": "test",
|
|
778
784
|
"entity": "user",
|
|
779
785
|
"action": "register",
|
|
780
|
-
"timestamp":
|
|
786
|
+
"timestamp": 1781482417000,
|
|
781
787
|
"timing": 3.14,
|
|
782
788
|
"source": {
|
|
783
789
|
"type": "collector",
|
|
@@ -857,11 +863,11 @@
|
|
|
857
863
|
"consent": {
|
|
858
864
|
"functional": true
|
|
859
865
|
},
|
|
860
|
-
"id": "
|
|
866
|
+
"id": "f5b28858beaa10a6",
|
|
861
867
|
"trigger": "load",
|
|
862
868
|
"entity": "product",
|
|
863
869
|
"action": "view",
|
|
864
|
-
"timestamp":
|
|
870
|
+
"timestamp": 1781482417000,
|
|
865
871
|
"timing": 3.14,
|
|
866
872
|
"source": {
|
|
867
873
|
"type": "collector",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/web-destination-tiktok",
|
|
3
3
|
"description": "TikTok Pixel web destination for walkerOS (conversion tracking, Advanced Matching)",
|
|
4
|
-
"version": "4.2.
|
|
4
|
+
"version": "4.2.1-next-1781538735002",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"update": "npx npm-check-updates -u && npm update"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@walkeros/core": "4.2.
|
|
42
|
-
"@walkeros/web-core": "4.2.
|
|
41
|
+
"@walkeros/core": "4.2.1-next-1781538735002",
|
|
42
|
+
"@walkeros/web-core": "4.2.1-next-1781538735002"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@walkeros/collector": "4.2.
|
|
45
|
+
"@walkeros/collector": "4.2.1-next-1781538735002"
|
|
46
46
|
},
|
|
47
47
|
"repository": {
|
|
48
48
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|