@walkeros/web-destination-piwikpro 4.7.2 → 4.8.0-next-1791496487198
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 +18 -0
- package/README.md +7 -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.js +2 -2
- package/dist/examples/index.mjs +3 -3
- package/dist/index.browser.js +1 -1
- package/dist/index.es5.js +1 -1
- package/dist/walkerOS.json +20 -20
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @walkeros/web-destination-piwikpro
|
|
2
2
|
|
|
3
|
+
## 4.8.0-next-1791496487198
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5593d7b: The `identified` description and hint now explain why its consent
|
|
8
|
+
states stay out of `config.consent`: a destination needs only one granted
|
|
9
|
+
state there, so a repeated state lets events through on its own, and as the
|
|
10
|
+
only state it holds events back, so no anonymous hit is sent.
|
|
11
|
+
- 5593d7b: The ecommerce step examples now test for a product entity without a
|
|
12
|
+
package helper. The published condition, shown in the docs and returned by
|
|
13
|
+
`package_get`, referenced a minified import and threw when copied into a flow;
|
|
14
|
+
it now runs on its own.
|
|
15
|
+
- Updated dependencies [7132619]
|
|
16
|
+
- Updated dependencies [5593d7b]
|
|
17
|
+
- Updated dependencies [421233d]
|
|
18
|
+
- @walkeros/core@4.8.0-next-1791496487198
|
|
19
|
+
- @walkeros/web-core@4.8.0-next-1791496487198
|
|
20
|
+
|
|
3
21
|
## 4.7.2
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -32,7 +32,13 @@ npm install @walkeros/web-destination-piwikpro
|
|
|
32
32
|
"destinations": {
|
|
33
33
|
"piwikpro": {
|
|
34
34
|
"package": "@walkeros/web-destination-piwikpro",
|
|
35
|
-
"config": {
|
|
35
|
+
"config": {
|
|
36
|
+
"loadScript": true,
|
|
37
|
+
"settings": {
|
|
38
|
+
"appId": "XXX-XXX-XXX-XXX-XXX",
|
|
39
|
+
"url": "https://your_account_name.piwik.pro/"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
36
42
|
}
|
|
37
43
|
}
|
|
38
44
|
}
|
package/dist/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,o=(e,a)=>{for(var i in a)t(e,i,{get:a[i],enumerable:!0})},r={};o(r,{examples:()=>v,hints:()=>G,schemas:()=>s}),module.exports=(e=r,((e,o,r,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let d of i(o))n.call(e,d)||d===r||t(e,d,{get:()=>o[d],enumerable:!(s=a(o,d))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s={};o(s,{MappingSchema:()=>g,SettingsSchema:()=>p,mapping:()=>h,settings:()=>k});var d=require("@walkeros/core/dev"),c=require("@walkeros/core/dev"),{ValueSchema:m}=c.schemas,l=c.z.record(c.z.string().regex(/^\d+$/,'Dimension keys are bare numeric ids like "1"'),m),p=c.z.object({appId:c.z.string().min(1).describe("ID of the Piwik PRO site (like XXX-XXX-XXX-XXX-XXX). Required when loadScript is true").optional(),url:c.z.string().url().describe("URL of your Piwik PRO account, normalized to one trailing slash (like https://your_account_name.piwik.pro/). Required when loadScript is true").optional(),linkTracking:c.z.boolean().default(!0).describe("Automatic outlink and download tracking, enabled right after the first hit this destination sends. Default: true"),identified:c.z.union([c.z.boolean(),c.z.record(c.z.string(),c.z.boolean())]).describe("Identified or anonymous tracking. true (default) identifies every hit, false switches the tracker to anonymous mode without cookies (disableCookies, deleteCookies, setUserIsAnonymous) at init. A consent object like { marketing: true } identifies only while that consent is granted and calls enableCookies and deanonymizeUser once it is. Do not repeat these states in config.consent, or events are queued and never reach the destination.").optional(),customDimensions:l.describe('Custom dimensions applied to every hit, keyed by bare dimension id (like { "1": "data.size" }). Rule-level customDimensions win per key.').optional()}),u=require("@walkeros/core/dev"),g=u.z.object({goalId:u.z.union([u.z.string(),u.z.number()]).describe("Piwik PRO goal id (UUID or legacy integer). Adds a second hit, trackGoal.").optional(),goalValue:u.schemas.ValueSchema.describe('Goal revenue, resolved from the event (like "data.total"), passed as the trackGoal conversion value').optional(),customDimensions:l.describe('Custom dimensions for this rule, keyed by bare dimension id (like { "1": "data.size" }). Wins per key over the destination customDimensions.').optional()}),k=(0,d.zodToSchema)(p),h=(0,d.zodToSchema)(g),v={};o(v,{env:()=>w,step:()=>P});var w={};o(w,{init:()=>y,push:()=>b,simulation:()=>f});var y={window:{},document:{createElement:()=>({type:"",src:"",async:!1,defer:!1}),head:{appendChild:()=>{}}}},b={window:{_paq:[]},document:{createElement:()=>({type:"",src:"",async:!1,defer:!1}),head:{appendChild:()=>{}}}},f=["call:window._paq.push"],P={};o(P,{cartUpdate:()=>C,customDimensionsEvent:()=>U,customDimensionsPageView:()=>x,customEvent:()=>z,ecommerceAddToCart:()=>O,ecommerceOrder:()=>D,ecommerceRemoveFromCart:()=>I,eventWithGoalValue:()=>V,init:()=>E,linkDownload:()=>T,linkTrackingAfterFirstHit:()=>R,pageViewWithGoal:()=>q,pageViewWithTitle:()=>A,ping:()=>j,productDetailView:()=>S,siteSearch:()=>_});var X=require("@walkeros/core"),E={title:"Initialization",description:"Destination bootstrap loads the Piwik PRO tracker and configures the tracker URL and app id.",in:{loadScript:!0,settings:{appId:"XXX-XXX-XXX-XXX-XXX",url:"https://your_account_name.piwik.pro/"}},out:[["_paq.push",["setTrackerUrl","https://your_account_name.piwik.pro/ppms.php"]],["_paq.push",["setSiteId","XXX-XXX-XXX-XXX-XXX"]]]},R={title:"Link tracking after the first hit",description:"With the default linkTracking setting, the first hit is followed by enableLinkTracking for automatic outlink and download tracking.",in:(0,X.getEvent)("page view",{timestamp:1700000312}),out:[["trackPageView","walkerOS documentation"],["enableLinkTracking"]]},D={title:"Ecommerce order",description:"A completed order calls Piwik PRO ecommerceOrder with line items and order totals.",in:(0,X.getEvent)("order complete",{timestamp:1700000300}),mapping:{name:"ecommerceOrder",data:{set:[{loop:["nested",{condition:e=>(0,X.isObject)(e)&&"product"===e.entity,map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"},customDimensions:{map:{1:"data.size"}}}}]},{map:{orderId:"data.id",grandTotal:"data.total",tax:"data.taxes",shipping:"data.shipping"}}]}},out:[["ecommerceOrder",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black",customDimensions:{1:"l"}},{sku:"cc",name:"Cool Cap",price:42,quantity:1,customDimensions:{1:"one size"}}],{orderId:"0rd3r1d",grandTotal:555,tax:73.76,shipping:5.22}]]},O={title:"Add to cart",description:"A product add fires Piwik PRO ecommerceAddToCart with the added item.",in:(0,X.getEvent)("product add",{timestamp:1700000301}),mapping:{name:"ecommerceAddToCart",data:{set:[{set:[{map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"},customDimensions:{map:{1:"data.size"}}}}]}]}},out:[["ecommerceAddToCart",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black",customDimensions:{1:"l"}}]]]},S={title:"Product detail view",description:"A product view fires Piwik PRO ecommerceProductDetailView with a single-item array.",in:(0,X.getEvent)("product view",{timestamp:1700000302}),mapping:{name:"ecommerceProductDetailView",data:{set:[{set:[{map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"},customDimensions:{map:{1:"data.size"}}}}]}]}},out:[["ecommerceProductDetailView",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black",customDimensions:{1:"l"}}]]]},C={title:"Cart update",description:"A cart view fires Piwik PRO ecommerceCartUpdate with nested products and the cart total.",in:(0,X.getEvent)("cart view",{timestamp:1700000303}),mapping:{name:"ecommerceCartUpdate",data:{set:[{loop:["nested",{condition:e=>(0,X.isObject)(e)&&"product"===e.entity,map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"},customDimensions:{map:{1:"data.size"}}}}]},"data.value"]}},out:[["ecommerceCartUpdate",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black",customDimensions:{1:"l"}}],840]]},z={title:"Custom event with goal",description:"A promotion visible event fires Piwik PRO trackEvent and then trackGoal to record a goal conversion.",in:(0,X.getEvent)("promotion visible",{timestamp:1700000304}),mapping:{name:"trackEvent",settings:{goalId:"goal_1"},data:{set:["data.name","data.position"]}},out:[["trackEvent","Setting up tracking easily","hero"],["trackGoal","goal_1"]]},A={title:"Page view",description:"A page view fires Piwik PRO trackPageView with the page title resolved from event data.",in:(0,X.getEvent)("page view",{timestamp:1700000305}),mapping:{data:"data.title"},out:[["trackPageView","walkerOS documentation"]]},q={title:"Page view with goal",description:"A page view rule with a goal keeps the default trackPageView and adds a trackGoal conversion.",in:(0,X.getEvent)("page view",{timestamp:1700000306}),mapping:{settings:{goalId:"goal_1"}},out:[["trackPageView","walkerOS documentation"],["trackGoal","goal_1"]]},V={title:"Event with goal value",description:"An order complete fires Piwik PRO trackEvent and then trackGoal with the order total as the conversion value.",in:(0,X.getEvent)("order complete",{timestamp:1700000307}),mapping:{name:"trackEvent",data:{set:[{value:"order"},{value:"complete"},"data.id"]},settings:{goalId:"goal_1",goalValue:"data.total"}},out:[["trackEvent","order","complete","0rd3r1d"],["trackGoal","goal_1",555]]},I={title:"Remove from cart",description:"A product remove fires Piwik PRO ecommerceRemoveFromCart with the removed item.",in:(0,X.getEvent)("product remove",{timestamp:1700000308,data:{id:"ers",name:"Everyday Ruck Snack",color:"black",size:"l",price:420}}),mapping:{name:"ecommerceRemoveFromCart",data:{set:[{set:[{map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"}}}]}]}},out:[["ecommerceRemoveFromCart",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black"}]]]},_={title:"Site search",description:"A search submit fires Piwik PRO trackSiteSearch with the keyword, category, and result count.",in:(0,X.getEvent)("search submit",{timestamp:1700000309,data:{query:"rucksack",category:"bags",results:12}}),mapping:{name:"trackSiteSearch",data:{set:["data.query","data.category","data.results"]}},out:[["trackSiteSearch","rucksack","bags",12]]},T={title:"Download link",description:"A file download fires Piwik PRO trackLink with the file URL and the download link type.",in:(0,X.getEvent)("file download",{timestamp:1700000310,data:{url:"https://www.example.com/whitepaper.pdf"}}),mapping:{name:"trackLink",data:{set:["data.url",{value:"download"}]}},out:[["trackLink","https://www.example.com/whitepaper.pdf","download"]]},j={title:"Ping",description:"A pulse-triggered event fires Piwik PRO ping to extend the time spent on the page.",in:(0,X.getEvent)("page ping",{timestamp:1700000311,trigger:"pulse"}),mapping:{name:"ping"},out:[["ping"]]},U={title:"Event with custom dimensions",description:"A product add fires Piwik PRO trackEvent with rule-level custom dimensions as its dimensions argument, values percent-encoded.",in:(0,X.getEvent)("product add",{timestamp:1700000313}),mapping:{name:"trackEvent",data:{set:["entity","action","data.name","data.price"]},settings:{customDimensions:{1:"data.size",2:"data.name"}}},out:[["trackEvent","product","add","Everyday Ruck Snack",420,{dimension1:"l",dimension2:"Everyday%20Ruck%20Snack"}]]},x={title:"Page view with custom dimensions",description:"trackPageView has no dimensions argument, so rule-level custom dimensions are set right before the hit and deleted right after it.",in:(0,X.getEvent)("page view",{timestamp:1700000314}),mapping:{settings:{customDimensions:{1:"globals.pagegroup"}}},out:[["setCustomDimensionValue",1,"docs"],["trackPageView","walkerOS documentation"],["deleteCustomDimension",1]]},G={"identified-consent":{text:'settings.identified controls identified or anonymous tracking. Absent or true: identified, the Piwik PRO default. false: anonymous from init, without tracker cookies (disableCookies, deleteCookies, setUserIsAnonymous(true)). A consent object like { "marketing": true }: anonymous and cookieless until that consent is granted, then enableCookies and deanonymizeUser merge the anonymous session into the identified visitor. Keep config.consent for the states that gate tracking at all; do not repeat the identified states there, or events are queued and never reach the destination.',code:[{lang:"json",code:'{ "consent": { "analytics": true }, "settings": { "identified": { "marketing": true } } }'}]},"custom-dimensions":{text:'customDimensions maps bare dimension ids to Mapping Values, at destination level (every hit) and at rule level (wins per key); a dimensions object the mapping passes as the method argument wins over both. trackEvent, trackGoal, trackSiteSearch and trackLink get { "dimension<id>": value } as their dimensions argument, values percent-encoded. Every other portable method (trackPageView, the content and ecommerce methods, ping) is wrapped: setCustomDimensionValue before the hit, then rule-only dimensions are deleted and destination values set again, so rule values never leak into automatic hits such as outlinks. Requires Piwik PRO tracker 15.3 or later.',code:[{lang:"json",code:'{ "settings": { "customDimensions": { "1": "globals.pagegroup" } }, "mapping": { "product": { "add": { "name": "trackEvent", "data": { "set": ["entity", "action", "data.name"] }, "settings": { "customDimensions": { "2": "data.size" } } } } } }'}]},"portable-methods":{text:"rule.name is a Piwik PRO JS API method and data resolves to its positional arguments (an array built with set is spread). The 13 portable methods (trackPageView, trackEvent, trackGoal, trackSiteSearch, trackLink, trackContentImpression, trackContentInteraction, ecommerceProductDetailView, ecommerceAddToCart, ecommerceRemoveFromCart, ecommerceCartUpdate, ecommerceOrder, ping) copy unchanged to the server destination @walkeros/server-destination-piwikpro. Any other _paq command, such as setUserId, works on web by explicit name but is web-only.",code:[{lang:"json",code:'{ "order": { "complete": { "name": "trackEvent", "data": { "set": ["entity", "action", "data.id"] }, "settings": { "goalId": "goal-uuid", "goalValue": "data.total" } } } }'}]},"unmapped-events":{text:"An event without a rule name that is not a page view sends only its goal when the rule has settings.goalId, and is otherwise skipped with a warning (once per event name, then at debug level). A named rule with silent: true also sends only its goal. To keep other events out of the destination entirely, ignore everything with a wildcard and keep the page view explicitly.",code:[{lang:"json",code:'{ "mapping": { "*": { "*": { "ignore": true } }, "page": { "view": {} } } }'}]}};//# sourceMappingURL=dev.js.map
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,o=(e,a)=>{for(var i in a)t(e,i,{get:a[i],enumerable:!0})},r={};o(r,{examples:()=>v,hints:()=>G,schemas:()=>s}),module.exports=(e=r,((e,o,r,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let d of i(o))n.call(e,d)||d===r||t(e,d,{get:()=>o[d],enumerable:!(s=a(o,d))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s={};o(s,{MappingSchema:()=>g,SettingsSchema:()=>p,mapping:()=>h,settings:()=>k});var d=require("@walkeros/core/dev"),c=require("@walkeros/core/dev"),{ValueSchema:m}=c.schemas,l=c.z.record(c.z.string().regex(/^\d+$/,'Dimension keys are bare numeric ids like "1"'),m),p=c.z.object({appId:c.z.string().min(1).describe("ID of the Piwik PRO site (like XXX-XXX-XXX-XXX-XXX). Required when loadScript is true").optional(),url:c.z.string().url().describe("URL of your Piwik PRO account, normalized to one trailing slash (like https://your_account_name.piwik.pro/). Required when loadScript is true").optional(),linkTracking:c.z.boolean().default(!0).describe("Automatic outlink and download tracking, enabled right after the first hit this destination sends. Default: true"),identified:c.z.union([c.z.boolean(),c.z.record(c.z.string(),c.z.boolean())]).describe("Identified or anonymous tracking. true (default) identifies every hit, false switches the tracker to anonymous mode without cookies (disableCookies, deleteCookies, setUserIsAnonymous) at init. A consent object like { marketing: true } identifies only while that consent is granted and calls enableCookies and deanonymizeUser once it is. Do not repeat these states in config.consent: a destination needs only one of its config.consent states granted, so next to another state the repeated one lets events through on its own, and as the only state it queues every event until granted, so no anonymous hit is sent.").optional(),customDimensions:l.describe('Custom dimensions applied to every hit, keyed by bare dimension id (like { "1": "data.size" }). Rule-level customDimensions win per key.').optional()}),u=require("@walkeros/core/dev"),g=u.z.object({goalId:u.z.union([u.z.string(),u.z.number()]).describe("Piwik PRO goal id (UUID or legacy integer). Adds a second hit, trackGoal.").optional(),goalValue:u.schemas.ValueSchema.describe('Goal revenue, resolved from the event (like "data.total"), passed as the trackGoal conversion value').optional(),customDimensions:l.describe('Custom dimensions for this rule, keyed by bare dimension id (like { "1": "data.size" }). Wins per key over the destination customDimensions.').optional()}),k=(0,d.zodToSchema)(p),h=(0,d.zodToSchema)(g),v={};o(v,{env:()=>w,step:()=>P});var w={};o(w,{init:()=>y,push:()=>f,simulation:()=>b});var y={window:{},document:{createElement:()=>({type:"",src:"",async:!1,defer:!1}),head:{appendChild:()=>{}}}},f={window:{_paq:[]},document:{createElement:()=>({type:"",src:"",async:!1,defer:!1}),head:{appendChild:()=>{}}}},b=["call:window._paq.push"],P={};o(P,{cartUpdate:()=>C,customDimensionsEvent:()=>j,customDimensionsPageView:()=>U,customEvent:()=>z,ecommerceAddToCart:()=>S,ecommerceOrder:()=>D,ecommerceRemoveFromCart:()=>I,eventWithGoalValue:()=>V,init:()=>E,linkDownload:()=>T,linkTrackingAfterFirstHit:()=>R,pageViewWithGoal:()=>q,pageViewWithTitle:()=>A,ping:()=>x,productDetailView:()=>O,siteSearch:()=>_});var X=require("@walkeros/core"),E={title:"Initialization",description:"Destination bootstrap loads the Piwik PRO tracker and configures the tracker URL and app id.",in:{loadScript:!0,settings:{appId:"XXX-XXX-XXX-XXX-XXX",url:"https://your_account_name.piwik.pro/"}},out:[["_paq.push",["setTrackerUrl","https://your_account_name.piwik.pro/ppms.php"]],["_paq.push",["setSiteId","XXX-XXX-XXX-XXX-XXX"]]]},R={title:"Link tracking after the first hit",description:"With the default linkTracking setting, the first hit is followed by enableLinkTracking for automatic outlink and download tracking.",in:(0,X.getEvent)("page view",{timestamp:1700000312}),out:[["trackPageView","walkerOS documentation"],["enableLinkTracking"]]},D={title:"Ecommerce order",description:"A completed order calls Piwik PRO ecommerceOrder with line items and order totals.",in:(0,X.getEvent)("order complete",{timestamp:1700000300}),mapping:{name:"ecommerceOrder",data:{set:[{loop:["nested",{condition:e=>"object"==typeof e&&null!==e&&"entity"in e&&"product"===e.entity,map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"},customDimensions:{map:{1:"data.size"}}}}]},{map:{orderId:"data.id",grandTotal:"data.total",tax:"data.taxes",shipping:"data.shipping"}}]}},out:[["ecommerceOrder",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black",customDimensions:{1:"l"}},{sku:"cc",name:"Cool Cap",price:42,quantity:1,customDimensions:{1:"one size"}}],{orderId:"0rd3r1d",grandTotal:555,tax:73.76,shipping:5.22}]]},S={title:"Add to cart",description:"A product add fires Piwik PRO ecommerceAddToCart with the added item.",in:(0,X.getEvent)("product add",{timestamp:1700000301}),mapping:{name:"ecommerceAddToCart",data:{set:[{set:[{map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"},customDimensions:{map:{1:"data.size"}}}}]}]}},out:[["ecommerceAddToCart",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black",customDimensions:{1:"l"}}]]]},O={title:"Product detail view",description:"A product view fires Piwik PRO ecommerceProductDetailView with a single-item array.",in:(0,X.getEvent)("product view",{timestamp:1700000302}),mapping:{name:"ecommerceProductDetailView",data:{set:[{set:[{map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"},customDimensions:{map:{1:"data.size"}}}}]}]}},out:[["ecommerceProductDetailView",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black",customDimensions:{1:"l"}}]]]},C={title:"Cart update",description:"A cart view fires Piwik PRO ecommerceCartUpdate with nested products and the cart total.",in:(0,X.getEvent)("cart view",{timestamp:1700000303}),mapping:{name:"ecommerceCartUpdate",data:{set:[{loop:["nested",{condition:e=>"object"==typeof e&&null!==e&&"entity"in e&&"product"===e.entity,map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"},customDimensions:{map:{1:"data.size"}}}}]},"data.value"]}},out:[["ecommerceCartUpdate",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black",customDimensions:{1:"l"}}],840]]},z={title:"Custom event with goal",description:"A promotion visible event fires Piwik PRO trackEvent and then trackGoal to record a goal conversion.",in:(0,X.getEvent)("promotion visible",{timestamp:1700000304}),mapping:{name:"trackEvent",settings:{goalId:"goal_1"},data:{set:["data.name","data.position"]}},out:[["trackEvent","Setting up tracking easily","hero"],["trackGoal","goal_1"]]},A={title:"Page view",description:"A page view fires Piwik PRO trackPageView with the page title resolved from event data.",in:(0,X.getEvent)("page view",{timestamp:1700000305}),mapping:{data:"data.title"},out:[["trackPageView","walkerOS documentation"]]},q={title:"Page view with goal",description:"A page view rule with a goal keeps the default trackPageView and adds a trackGoal conversion.",in:(0,X.getEvent)("page view",{timestamp:1700000306}),mapping:{settings:{goalId:"goal_1"}},out:[["trackPageView","walkerOS documentation"],["trackGoal","goal_1"]]},V={title:"Event with goal value",description:"An order complete fires Piwik PRO trackEvent and then trackGoal with the order total as the conversion value.",in:(0,X.getEvent)("order complete",{timestamp:1700000307}),mapping:{name:"trackEvent",data:{set:[{value:"order"},{value:"complete"},"data.id"]},settings:{goalId:"goal_1",goalValue:"data.total"}},out:[["trackEvent","order","complete","0rd3r1d"],["trackGoal","goal_1",555]]},I={title:"Remove from cart",description:"A product remove fires Piwik PRO ecommerceRemoveFromCart with the removed item.",in:(0,X.getEvent)("product remove",{timestamp:1700000308,data:{id:"ers",name:"Everyday Ruck Snack",color:"black",size:"l",price:420}}),mapping:{name:"ecommerceRemoveFromCart",data:{set:[{set:[{map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"}}}]}]}},out:[["ecommerceRemoveFromCart",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black"}]]]},_={title:"Site search",description:"A search submit fires Piwik PRO trackSiteSearch with the keyword, category, and result count.",in:(0,X.getEvent)("search submit",{timestamp:1700000309,data:{query:"rucksack",category:"bags",results:12}}),mapping:{name:"trackSiteSearch",data:{set:["data.query","data.category","data.results"]}},out:[["trackSiteSearch","rucksack","bags",12]]},T={title:"Download link",description:"A file download fires Piwik PRO trackLink with the file URL and the download link type.",in:(0,X.getEvent)("file download",{timestamp:1700000310,data:{url:"https://www.example.com/whitepaper.pdf"}}),mapping:{name:"trackLink",data:{set:["data.url",{value:"download"}]}},out:[["trackLink","https://www.example.com/whitepaper.pdf","download"]]},x={title:"Ping",description:"A pulse-triggered event fires Piwik PRO ping to extend the time spent on the page.",in:(0,X.getEvent)("page ping",{timestamp:1700000311,trigger:"pulse"}),mapping:{name:"ping"},out:[["ping"]]},j={title:"Event with custom dimensions",description:"A product add fires Piwik PRO trackEvent with rule-level custom dimensions as its dimensions argument, values percent-encoded.",in:(0,X.getEvent)("product add",{timestamp:1700000313}),mapping:{name:"trackEvent",data:{set:["entity","action","data.name","data.price"]},settings:{customDimensions:{1:"data.size",2:"data.name"}}},out:[["trackEvent","product","add","Everyday Ruck Snack",420,{dimension1:"l",dimension2:"Everyday%20Ruck%20Snack"}]]},U={title:"Page view with custom dimensions",description:"trackPageView has no dimensions argument, so rule-level custom dimensions are set right before the hit and deleted right after it.",in:(0,X.getEvent)("page view",{timestamp:1700000314}),mapping:{settings:{customDimensions:{1:"globals.pagegroup"}}},out:[["setCustomDimensionValue",1,"docs"],["trackPageView","walkerOS documentation"],["deleteCustomDimension",1]]},G={"identified-consent":{text:'settings.identified controls identified or anonymous tracking. Absent or true: identified, the Piwik PRO default. false: anonymous from init, without tracker cookies (disableCookies, deleteCookies, setUserIsAnonymous(true)). A consent object like { "marketing": true }: anonymous and cookieless until that consent is granted, then enableCookies and deanonymizeUser merge the anonymous session into the identified visitor. Keep config.consent for the states that gate tracking at all and do not repeat the identified states there: a destination needs only one of its config.consent states granted, so next to another state the repeated one lets events through on its own, and as the only state it queues every event until granted, so no anonymous hit is sent.',code:[{lang:"json",code:'{ "consent": { "analytics": true }, "settings": { "identified": { "marketing": true } } }'}]},"custom-dimensions":{text:'customDimensions maps bare dimension ids to Mapping Values, at destination level (every hit) and at rule level (wins per key); a dimensions object the mapping passes as the method argument wins over both. trackEvent, trackGoal, trackSiteSearch and trackLink get { "dimension<id>": value } as their dimensions argument, values percent-encoded. Every other portable method (trackPageView, the content and ecommerce methods, ping) is wrapped: setCustomDimensionValue before the hit, then rule-only dimensions are deleted and destination values set again, so rule values never leak into automatic hits such as outlinks. Requires Piwik PRO tracker 15.3 or later.',code:[{lang:"json",code:'{ "settings": { "customDimensions": { "1": "globals.pagegroup" } }, "mapping": { "product": { "add": { "name": "trackEvent", "data": { "set": ["entity", "action", "data.name"] }, "settings": { "customDimensions": { "2": "data.size" } } } } } }'}]},"portable-methods":{text:"rule.name is a Piwik PRO JS API method and data resolves to its positional arguments (an array built with set is spread). The 13 portable methods (trackPageView, trackEvent, trackGoal, trackSiteSearch, trackLink, trackContentImpression, trackContentInteraction, ecommerceProductDetailView, ecommerceAddToCart, ecommerceRemoveFromCart, ecommerceCartUpdate, ecommerceOrder, ping) copy unchanged to the server destination @walkeros/server-destination-piwikpro. Any other _paq command, such as setUserId, works on web by explicit name but is web-only.",code:[{lang:"json",code:'{ "order": { "complete": { "name": "trackEvent", "data": { "set": ["entity", "action", "data.id"] }, "settings": { "goalId": "goal-uuid", "goalValue": "data.total" } } } }'}]},"unmapped-events":{text:"An event without a rule name that is not a page view sends only its goal when the rule has settings.goalId, and is otherwise skipped with a warning (once per event name, then at debug level). A named rule with silent: true also sends only its goal. To keep other events out of the destination entirely, ignore everything with a wildcard and keep the page view explicitly.",code:[{lang:"json",code:'{ "mapping": { "*": { "*": { "ignore": true } }, "page": { "view": {} } } }'}]}};//# 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","../src/hints.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\nexport { hints } from './hints';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\n// Types of record live in ../types; the zod types loosen through core's ValueSchema\nexport { SettingsSchema } from './settings';\nexport { MappingSchema } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { schemas, z } from '@walkeros/core/dev';\n\nconst { ValueSchema } = schemas;\n\nexport const CustomDimensionsSchema = z.record(\n z.string().regex(/^\\d+$/, 'Dimension keys are bare numeric ids like \"1\"'),\n ValueSchema,\n);\n\nexport const SettingsSchema = z.object({\n appId: z\n .string()\n .min(1)\n .describe(\n 'ID of the Piwik PRO site (like XXX-XXX-XXX-XXX-XXX). Required when loadScript is true',\n )\n .optional(),\n url: z\n .string()\n .url()\n .describe(\n 'URL of your Piwik PRO account, normalized to one trailing slash (like https://your_account_name.piwik.pro/). Required when loadScript is true',\n )\n .optional(),\n linkTracking: z\n .boolean()\n .default(true)\n .describe(\n 'Automatic outlink and download tracking, enabled right after the first hit this destination sends. Default: true',\n ),\n identified: z\n .union([z.boolean(), z.record(z.string(), z.boolean())])\n .describe(\n 'Identified or anonymous tracking. true (default) identifies every hit, false switches the tracker to anonymous mode without cookies (disableCookies, deleteCookies, setUserIsAnonymous) at init. A consent object like { marketing: true } identifies only while that consent is granted and calls enableCookies and deanonymizeUser once it is. Do not repeat these states in config.consent, or events are queued and never reach the destination.',\n )\n .optional(),\n customDimensions: CustomDimensionsSchema.describe(\n 'Custom dimensions applied to every hit, keyed by bare dimension id (like { \"1\": \"data.size\" }). Rule-level customDimensions win per key.',\n ).optional(),\n});\n","import { schemas, z } from '@walkeros/core/dev';\nimport { CustomDimensionsSchema } from './settings';\n\nexport const MappingSchema = z.object({\n goalId: z\n .union([z.string(), z.number()])\n .describe(\n 'Piwik PRO goal id (UUID or legacy integer). Adds a second hit, trackGoal.',\n )\n .optional(),\n goalValue: schemas.ValueSchema.describe(\n 'Goal revenue, resolved from the event (like \"data.total\"), passed as the trackGoal conversion value',\n ).optional(),\n customDimensions: CustomDimensionsSchema.describe(\n 'Custom dimensions for this rule, keyed by bare dimension id (like { \"1\": \"data.size\" }). Wins per key over the destination customDimensions.',\n ).optional(),\n});\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for PiwikPro destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring external dependencies.\n */\n\nexport const init: Env | undefined = {\n window: {\n // _paq absent: init() is expected to install the queue.\n },\n document: {\n createElement: () => ({\n type: '',\n src: '',\n async: false,\n defer: false,\n }),\n head: { appendChild: () => {} },\n },\n};\n\nexport const push: Env = {\n window: {\n _paq: [],\n },\n document: {\n createElement: () => ({\n type: '',\n src: '',\n async: false,\n defer: false,\n }),\n head: { appendChild: () => {} },\n },\n};\n\n/**\n * Simulation tracking paths\n * Specifies which function calls to track during simulation\n */\nexport const simulation = [\n 'call:window._paq.push', // Track _paq.push calls\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent, isObject } from '@walkeros/core';\n\n/**\n * Destination bootstrap.\n * Given the canonical settings, init loads the PiwikPro script and configures\n * the tracker URL and app id. Link tracking follows the first hit instead\n * (see `linkTrackingAfterFirstHit`). Reproduce by passing the same settings to\n * `startFlow` as the destination config.\n */\nexport const init: Flow.StepExample = {\n title: 'Initialization',\n description:\n 'Destination bootstrap loads the Piwik PRO tracker and configures the tracker URL and app id.',\n in: {\n loadScript: true,\n settings: {\n appId: 'XXX-XXX-XXX-XXX-XXX',\n url: 'https://your_account_name.piwik.pro/',\n },\n },\n out: [\n [\n '_paq.push',\n ['setTrackerUrl', 'https://your_account_name.piwik.pro/ppms.php'],\n ],\n ['_paq.push', ['setSiteId', 'XXX-XXX-XXX-XXX-XXX']],\n ],\n};\n\n/**\n * Runs with the default settings (linkTracking on). The other event examples\n * run with `linkTracking: false`, so their `out` holds only their own commands.\n */\nexport const linkTrackingAfterFirstHit: Flow.StepExample = {\n title: 'Link tracking after the first hit',\n description:\n 'With the default linkTracking setting, the first hit is followed by enableLinkTracking for automatic outlink and download tracking.',\n in: getEvent('page view', { timestamp: 1700000312 }),\n out: [['trackPageView', 'walkerOS documentation'], ['enableLinkTracking']],\n};\n\nexport const ecommerceOrder: Flow.StepExample = {\n title: 'Ecommerce order',\n description:\n 'A completed order calls Piwik PRO ecommerceOrder with line items and order totals.',\n in: getEvent('order complete', { timestamp: 1700000300 }),\n mapping: {\n name: 'ecommerceOrder',\n data: {\n set: [\n {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n customDimensions: {\n map: {\n 1: 'data.size',\n },\n },\n },\n },\n ],\n },\n {\n map: {\n orderId: 'data.id',\n grandTotal: 'data.total',\n tax: 'data.taxes',\n shipping: 'data.shipping',\n },\n },\n ],\n },\n },\n out: [\n [\n 'ecommerceOrder',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n customDimensions: { 1: 'l' },\n },\n {\n sku: 'cc',\n name: 'Cool Cap',\n price: 42,\n quantity: 1,\n customDimensions: { 1: 'one size' },\n },\n ],\n {\n orderId: '0rd3r1d',\n grandTotal: 555,\n tax: 73.76,\n shipping: 5.22,\n },\n ],\n ],\n};\n\nexport const ecommerceAddToCart: Flow.StepExample = {\n title: 'Add to cart',\n description:\n 'A product add fires Piwik PRO ecommerceAddToCart with the added item.',\n in: getEvent('product add', { timestamp: 1700000301 }),\n mapping: {\n name: 'ecommerceAddToCart',\n data: {\n set: [\n {\n set: [\n {\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n customDimensions: {\n map: {\n 1: 'data.size',\n },\n },\n },\n },\n ],\n },\n ],\n },\n },\n out: [\n [\n 'ecommerceAddToCart',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n customDimensions: { 1: 'l' },\n },\n ],\n ],\n ],\n};\n\nexport const productDetailView: Flow.StepExample = {\n title: 'Product detail view',\n description:\n 'A product view fires Piwik PRO ecommerceProductDetailView with a single-item array.',\n in: getEvent('product view', { timestamp: 1700000302 }),\n mapping: {\n name: 'ecommerceProductDetailView',\n data: {\n set: [\n {\n set: [\n {\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n customDimensions: {\n map: {\n 1: 'data.size',\n },\n },\n },\n },\n ],\n },\n ],\n },\n },\n out: [\n [\n 'ecommerceProductDetailView',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n customDimensions: { 1: 'l' },\n },\n ],\n ],\n ],\n};\n\nexport const cartUpdate: Flow.StepExample = {\n title: 'Cart update',\n description:\n 'A cart view fires Piwik PRO ecommerceCartUpdate with nested products and the cart total.',\n in: getEvent('cart view', { timestamp: 1700000303 }),\n mapping: {\n name: 'ecommerceCartUpdate',\n data: {\n set: [\n {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n customDimensions: {\n map: {\n 1: 'data.size',\n },\n },\n },\n },\n ],\n },\n 'data.value',\n ],\n },\n },\n out: [\n [\n 'ecommerceCartUpdate',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n customDimensions: { 1: 'l' },\n },\n ],\n 840,\n ],\n ],\n};\n\nexport const customEvent: Flow.StepExample = {\n title: 'Custom event with goal',\n description:\n 'A promotion visible event fires Piwik PRO trackEvent and then trackGoal to record a goal conversion.',\n in: getEvent('promotion visible', { timestamp: 1700000304 }),\n mapping: {\n name: 'trackEvent',\n settings: {\n goalId: 'goal_1',\n },\n data: {\n set: ['data.name', 'data.position'],\n },\n },\n out: [\n ['trackEvent', 'Setting up tracking easily', 'hero'],\n ['trackGoal', 'goal_1'],\n ],\n};\n\nexport const pageViewWithTitle: Flow.StepExample = {\n title: 'Page view',\n description:\n 'A page view fires Piwik PRO trackPageView with the page title resolved from event data.',\n in: getEvent('page view', { timestamp: 1700000305 }),\n mapping: {\n data: 'data.title',\n },\n out: [['trackPageView', 'walkerOS documentation']],\n};\n\nexport const pageViewWithGoal: Flow.StepExample = {\n title: 'Page view with goal',\n description:\n 'A page view rule with a goal keeps the default trackPageView and adds a trackGoal conversion.',\n in: getEvent('page view', { timestamp: 1700000306 }),\n mapping: {\n settings: {\n goalId: 'goal_1',\n },\n },\n out: [\n ['trackPageView', 'walkerOS documentation'],\n ['trackGoal', 'goal_1'],\n ],\n};\n\nexport const eventWithGoalValue: Flow.StepExample = {\n title: 'Event with goal value',\n description:\n 'An order complete fires Piwik PRO trackEvent and then trackGoal with the order total as the conversion value.',\n in: getEvent('order complete', { timestamp: 1700000307 }),\n mapping: {\n name: 'trackEvent',\n data: {\n set: [{ value: 'order' }, { value: 'complete' }, 'data.id'],\n },\n settings: {\n goalId: 'goal_1',\n goalValue: 'data.total',\n },\n },\n out: [\n ['trackEvent', 'order', 'complete', '0rd3r1d'],\n ['trackGoal', 'goal_1', 555],\n ],\n};\n\nexport const ecommerceRemoveFromCart: Flow.StepExample = {\n title: 'Remove from cart',\n description:\n 'A product remove fires Piwik PRO ecommerceRemoveFromCart with the removed item.',\n in: getEvent('product remove', {\n timestamp: 1700000308,\n data: {\n id: 'ers',\n name: 'Everyday Ruck Snack',\n color: 'black',\n size: 'l',\n price: 420,\n },\n }),\n mapping: {\n name: 'ecommerceRemoveFromCart',\n data: {\n set: [\n {\n set: [\n {\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n },\n },\n ],\n },\n ],\n },\n },\n out: [\n [\n 'ecommerceRemoveFromCart',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n },\n ],\n ],\n ],\n};\n\nexport const siteSearch: Flow.StepExample = {\n title: 'Site search',\n description:\n 'A search submit fires Piwik PRO trackSiteSearch with the keyword, category, and result count.',\n in: getEvent('search submit', {\n timestamp: 1700000309,\n data: { query: 'rucksack', category: 'bags', results: 12 },\n }),\n mapping: {\n name: 'trackSiteSearch',\n data: {\n set: ['data.query', 'data.category', 'data.results'],\n },\n },\n out: [['trackSiteSearch', 'rucksack', 'bags', 12]],\n};\n\nexport const linkDownload: Flow.StepExample = {\n title: 'Download link',\n description:\n 'A file download fires Piwik PRO trackLink with the file URL and the download link type.',\n in: getEvent('file download', {\n timestamp: 1700000310,\n data: { url: 'https://www.example.com/whitepaper.pdf' },\n }),\n mapping: {\n name: 'trackLink',\n data: {\n set: ['data.url', { value: 'download' }],\n },\n },\n out: [['trackLink', 'https://www.example.com/whitepaper.pdf', 'download']],\n};\n\nexport const ping: Flow.StepExample = {\n title: 'Ping',\n description:\n 'A pulse-triggered event fires Piwik PRO ping to extend the time spent on the page.',\n in: getEvent('page ping', { timestamp: 1700000311, trigger: 'pulse' }),\n mapping: {\n name: 'ping',\n },\n out: [['ping']],\n};\n\nexport const customDimensionsEvent: Flow.StepExample = {\n title: 'Event with custom dimensions',\n description:\n 'A product add fires Piwik PRO trackEvent with rule-level custom dimensions as its dimensions argument, values percent-encoded.',\n in: getEvent('product add', { timestamp: 1700000313 }),\n mapping: {\n name: 'trackEvent',\n data: {\n set: ['entity', 'action', 'data.name', 'data.price'],\n },\n settings: {\n customDimensions: {\n 1: 'data.size',\n 2: 'data.name',\n },\n },\n },\n out: [\n [\n 'trackEvent',\n 'product',\n 'add',\n 'Everyday Ruck Snack',\n 420,\n { dimension1: 'l', dimension2: 'Everyday%20Ruck%20Snack' },\n ],\n ],\n};\n\nexport const customDimensionsPageView: Flow.StepExample = {\n title: 'Page view with custom dimensions',\n description:\n 'trackPageView has no dimensions argument, so rule-level custom dimensions are set right before the hit and deleted right after it.',\n in: getEvent('page view', { timestamp: 1700000314 }),\n mapping: {\n settings: {\n customDimensions: {\n 1: 'globals.pagegroup',\n },\n },\n },\n out: [\n ['setCustomDimensionValue', 1, 'docs'],\n ['trackPageView', 'walkerOS documentation'],\n ['deleteCustomDimension', 1],\n ],\n};\n","import type { Hint } from '@walkeros/core';\n\nexport const hints: Hint.Hints = {\n 'identified-consent': {\n text: 'settings.identified controls identified or anonymous tracking. Absent or true: identified, the Piwik PRO default. false: anonymous from init, without tracker cookies (disableCookies, deleteCookies, setUserIsAnonymous(true)). A consent object like { \"marketing\": true }: anonymous and cookieless until that consent is granted, then enableCookies and deanonymizeUser merge the anonymous session into the identified visitor. Keep config.consent for the states that gate tracking at all; do not repeat the identified states there, or events are queued and never reach the destination.',\n code: [\n {\n lang: 'json',\n code: '{ \"consent\": { \"analytics\": true }, \"settings\": { \"identified\": { \"marketing\": true } } }',\n },\n ],\n },\n 'custom-dimensions': {\n text: 'customDimensions maps bare dimension ids to Mapping Values, at destination level (every hit) and at rule level (wins per key); a dimensions object the mapping passes as the method argument wins over both. trackEvent, trackGoal, trackSiteSearch and trackLink get { \"dimension<id>\": value } as their dimensions argument, values percent-encoded. Every other portable method (trackPageView, the content and ecommerce methods, ping) is wrapped: setCustomDimensionValue before the hit, then rule-only dimensions are deleted and destination values set again, so rule values never leak into automatic hits such as outlinks. Requires Piwik PRO tracker 15.3 or later.',\n code: [\n {\n lang: 'json',\n code: '{ \"settings\": { \"customDimensions\": { \"1\": \"globals.pagegroup\" } }, \"mapping\": { \"product\": { \"add\": { \"name\": \"trackEvent\", \"data\": { \"set\": [\"entity\", \"action\", \"data.name\"] }, \"settings\": { \"customDimensions\": { \"2\": \"data.size\" } } } } } }',\n },\n ],\n },\n 'portable-methods': {\n text: 'rule.name is a Piwik PRO JS API method and data resolves to its positional arguments (an array built with set is spread). The 13 portable methods (trackPageView, trackEvent, trackGoal, trackSiteSearch, trackLink, trackContentImpression, trackContentInteraction, ecommerceProductDetailView, ecommerceAddToCart, ecommerceRemoveFromCart, ecommerceCartUpdate, ecommerceOrder, ping) copy unchanged to the server destination @walkeros/server-destination-piwikpro. Any other _paq command, such as setUserId, works on web by explicit name but is web-only.',\n code: [\n {\n lang: 'json',\n code: '{ \"order\": { \"complete\": { \"name\": \"trackEvent\", \"data\": { \"set\": [\"entity\", \"action\", \"data.id\"] }, \"settings\": { \"goalId\": \"goal-uuid\", \"goalValue\": \"data.total\" } } } }',\n },\n ],\n },\n 'unmapped-events': {\n text: 'An event without a rule name that is not a page view sends only its goal when the rule has settings.goalId, and is otherwise skipped with a warning (once per event name, then at debug level). A named rule with silent: true also sends only its goal. To keep other events out of the destination entirely, ignore everything with a wildcard and keep the page view explicitly.',\n code: [\n {\n lang: 'json',\n code: '{ \"mapping\": { \"*\": { \"*\": { \"ignore\": true } }, \"page\": { \"view\": {} } } }',\n },\n ],\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAA2B;AAE3B,IAAM,EAAE,YAAY,IAAI;AAEjB,IAAM,yBAAyB,aAAE;AAAA,EACtC,aAAE,OAAO,EAAE,MAAM,SAAS,8CAA8C;AAAA,EACxE;AACF;AAEO,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACrC,OAAO,aACJ,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,KAAK,aACF,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,cAAc,aACX,QAAQ,EACR,QAAQ,IAAI,EACZ;AAAA,IACC;AAAA,EACF;AAAA,EACF,YAAY,aACT,MAAM,CAAC,aAAE,QAAQ,G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AAAA,QACH,GAAG;AAAA,MACL;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,EAAE,YAAY,KAAK,YAAY,0BAA0B;AAAA,IAC3D;AAAA,EACF;AACF;AAEO,IAAM,2BAA6C;AAAA,EACxD,OAAO;AAAA,EACP,aACE;AAAA,EACF,QAAI,sBAAS,aAAa,EAAE,WAAW,WAAW,CAAC;AAAA,EACnD,SAAS;AAAA,IACP,UAAU;AAAA,MACR,kBAAkB;AAAA,QAChB,GAAG;AAAA,MACL;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH,CAAC,2BAA2B,GAAG,MAAM;AAAA,IACrC,CAAC,iBAAiB,wBAAwB;AAAA,IAC1C,CAAC,yBAAyB,CAAC;AAAA,EAC7B;AACF;;;ACldO,IAAM,QAAoB;AAAA,EAC/B,sBAAsB;AAAA,IACpB,MAAM;AAAA,IACN,MAAM;AAAA,MACJ;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAAA,EACA,qBAAqB;AAAA,IACnB,MAAM;AAAA,IACN,MAAM;AAAA,MACJ;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAAA,EACA,oBAAoB;AAAA,IAClB,MAAM;AAAA,IACN,MAAM;AAAA,MACJ;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAAA,EACA,mBAAmB;AAAA,IACjB,MAAM;AAAA,IACN,MAAM;AAAA,MACJ;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;","names":["import_dev","import_dev","init"]}
|
|
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","../src/hints.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\nexport { hints } from './hints';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\n// Types of record live in ../types; the zod types loosen through core's ValueSchema\nexport { SettingsSchema } from './settings';\nexport { MappingSchema } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { schemas, z } from '@walkeros/core/dev';\n\nconst { ValueSchema } = schemas;\n\nexport const CustomDimensionsSchema = z.record(\n z.string().regex(/^\\d+$/, 'Dimension keys are bare numeric ids like \"1\"'),\n ValueSchema,\n);\n\nexport const SettingsSchema = z.object({\n appId: z\n .string()\n .min(1)\n .describe(\n 'ID of the Piwik PRO site (like XXX-XXX-XXX-XXX-XXX). Required when loadScript is true',\n )\n .optional(),\n url: z\n .string()\n .url()\n .describe(\n 'URL of your Piwik PRO account, normalized to one trailing slash (like https://your_account_name.piwik.pro/). Required when loadScript is true',\n )\n .optional(),\n linkTracking: z\n .boolean()\n .default(true)\n .describe(\n 'Automatic outlink and download tracking, enabled right after the first hit this destination sends. Default: true',\n ),\n identified: z\n .union([z.boolean(), z.record(z.string(), z.boolean())])\n .describe(\n 'Identified or anonymous tracking. true (default) identifies every hit, false switches the tracker to anonymous mode without cookies (disableCookies, deleteCookies, setUserIsAnonymous) at init. A consent object like { marketing: true } identifies only while that consent is granted and calls enableCookies and deanonymizeUser once it is. Do not repeat these states in config.consent: a destination needs only one of its config.consent states granted, so next to another state the repeated one lets events through on its own, and as the only state it queues every event until granted, so no anonymous hit is sent.',\n )\n .optional(),\n customDimensions: CustomDimensionsSchema.describe(\n 'Custom dimensions applied to every hit, keyed by bare dimension id (like { \"1\": \"data.size\" }). Rule-level customDimensions win per key.',\n ).optional(),\n});\n","import { schemas, z } from '@walkeros/core/dev';\nimport { CustomDimensionsSchema } from './settings';\n\nexport const MappingSchema = z.object({\n goalId: z\n .union([z.string(), z.number()])\n .describe(\n 'Piwik PRO goal id (UUID or legacy integer). Adds a second hit, trackGoal.',\n )\n .optional(),\n goalValue: schemas.ValueSchema.describe(\n 'Goal revenue, resolved from the event (like \"data.total\"), passed as the trackGoal conversion value',\n ).optional(),\n customDimensions: CustomDimensionsSchema.describe(\n 'Custom dimensions for this rule, keyed by bare dimension id (like { \"1\": \"data.size\" }). Wins per key over the destination customDimensions.',\n ).optional(),\n});\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for PiwikPro destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring external dependencies.\n */\n\nexport const init: Env | undefined = {\n window: {\n // _paq absent: init() is expected to install the queue.\n },\n document: {\n createElement: () => ({\n type: '',\n src: '',\n async: false,\n defer: false,\n }),\n head: { appendChild: () => {} },\n },\n};\n\nexport const push: Env = {\n window: {\n _paq: [],\n },\n document: {\n createElement: () => ({\n type: '',\n src: '',\n async: false,\n defer: false,\n }),\n head: { appendChild: () => {} },\n },\n};\n\n/**\n * Simulation tracking paths\n * Specifies which function calls to track during simulation\n */\nexport const simulation = [\n 'call:window._paq.push', // Track _paq.push calls\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\n/**\n * Destination bootstrap.\n * Given the canonical settings, init loads the PiwikPro script and configures\n * the tracker URL and app id. Link tracking follows the first hit instead\n * (see `linkTrackingAfterFirstHit`). Reproduce by passing the same settings to\n * `startFlow` as the destination config.\n */\nexport const init: Flow.StepExample = {\n title: 'Initialization',\n description:\n 'Destination bootstrap loads the Piwik PRO tracker and configures the tracker URL and app id.',\n in: {\n loadScript: true,\n settings: {\n appId: 'XXX-XXX-XXX-XXX-XXX',\n url: 'https://your_account_name.piwik.pro/',\n },\n },\n out: [\n [\n '_paq.push',\n ['setTrackerUrl', 'https://your_account_name.piwik.pro/ppms.php'],\n ],\n ['_paq.push', ['setSiteId', 'XXX-XXX-XXX-XXX-XXX']],\n ],\n};\n\n/**\n * Runs with the default settings (linkTracking on). The other event examples\n * run with `linkTracking: false`, so their `out` holds only their own commands.\n */\nexport const linkTrackingAfterFirstHit: Flow.StepExample = {\n title: 'Link tracking after the first hit',\n description:\n 'With the default linkTracking setting, the first hit is followed by enableLinkTracking for automatic outlink and download tracking.',\n in: getEvent('page view', { timestamp: 1700000312 }),\n out: [['trackPageView', 'walkerOS documentation'], ['enableLinkTracking']],\n};\n\nexport const ecommerceOrder: Flow.StepExample = {\n title: 'Ecommerce order',\n description:\n 'A completed order calls Piwik PRO ecommerceOrder with line items and order totals.',\n in: getEvent('order complete', { timestamp: 1700000300 }),\n mapping: {\n name: 'ecommerceOrder',\n data: {\n set: [\n {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n typeof entity === 'object' &&\n entity !== null &&\n 'entity' in entity &&\n entity.entity === 'product',\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n customDimensions: {\n map: {\n 1: 'data.size',\n },\n },\n },\n },\n ],\n },\n {\n map: {\n orderId: 'data.id',\n grandTotal: 'data.total',\n tax: 'data.taxes',\n shipping: 'data.shipping',\n },\n },\n ],\n },\n },\n out: [\n [\n 'ecommerceOrder',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n customDimensions: { 1: 'l' },\n },\n {\n sku: 'cc',\n name: 'Cool Cap',\n price: 42,\n quantity: 1,\n customDimensions: { 1: 'one size' },\n },\n ],\n {\n orderId: '0rd3r1d',\n grandTotal: 555,\n tax: 73.76,\n shipping: 5.22,\n },\n ],\n ],\n};\n\nexport const ecommerceAddToCart: Flow.StepExample = {\n title: 'Add to cart',\n description:\n 'A product add fires Piwik PRO ecommerceAddToCart with the added item.',\n in: getEvent('product add', { timestamp: 1700000301 }),\n mapping: {\n name: 'ecommerceAddToCart',\n data: {\n set: [\n {\n set: [\n {\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n customDimensions: {\n map: {\n 1: 'data.size',\n },\n },\n },\n },\n ],\n },\n ],\n },\n },\n out: [\n [\n 'ecommerceAddToCart',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n customDimensions: { 1: 'l' },\n },\n ],\n ],\n ],\n};\n\nexport const productDetailView: Flow.StepExample = {\n title: 'Product detail view',\n description:\n 'A product view fires Piwik PRO ecommerceProductDetailView with a single-item array.',\n in: getEvent('product view', { timestamp: 1700000302 }),\n mapping: {\n name: 'ecommerceProductDetailView',\n data: {\n set: [\n {\n set: [\n {\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n customDimensions: {\n map: {\n 1: 'data.size',\n },\n },\n },\n },\n ],\n },\n ],\n },\n },\n out: [\n [\n 'ecommerceProductDetailView',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n customDimensions: { 1: 'l' },\n },\n ],\n ],\n ],\n};\n\nexport const cartUpdate: Flow.StepExample = {\n title: 'Cart update',\n description:\n 'A cart view fires Piwik PRO ecommerceCartUpdate with nested products and the cart total.',\n in: getEvent('cart view', { timestamp: 1700000303 }),\n mapping: {\n name: 'ecommerceCartUpdate',\n data: {\n set: [\n {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n typeof entity === 'object' &&\n entity !== null &&\n 'entity' in entity &&\n entity.entity === 'product',\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n customDimensions: {\n map: {\n 1: 'data.size',\n },\n },\n },\n },\n ],\n },\n 'data.value',\n ],\n },\n },\n out: [\n [\n 'ecommerceCartUpdate',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n customDimensions: { 1: 'l' },\n },\n ],\n 840,\n ],\n ],\n};\n\nexport const customEvent: Flow.StepExample = {\n title: 'Custom event with goal',\n description:\n 'A promotion visible event fires Piwik PRO trackEvent and then trackGoal to record a goal conversion.',\n in: getEvent('promotion visible', { timestamp: 1700000304 }),\n mapping: {\n name: 'trackEvent',\n settings: {\n goalId: 'goal_1',\n },\n data: {\n set: ['data.name', 'data.position'],\n },\n },\n out: [\n ['trackEvent', 'Setting up tracking easily', 'hero'],\n ['trackGoal', 'goal_1'],\n ],\n};\n\nexport const pageViewWithTitle: Flow.StepExample = {\n title: 'Page view',\n description:\n 'A page view fires Piwik PRO trackPageView with the page title resolved from event data.',\n in: getEvent('page view', { timestamp: 1700000305 }),\n mapping: {\n data: 'data.title',\n },\n out: [['trackPageView', 'walkerOS documentation']],\n};\n\nexport const pageViewWithGoal: Flow.StepExample = {\n title: 'Page view with goal',\n description:\n 'A page view rule with a goal keeps the default trackPageView and adds a trackGoal conversion.',\n in: getEvent('page view', { timestamp: 1700000306 }),\n mapping: {\n settings: {\n goalId: 'goal_1',\n },\n },\n out: [\n ['trackPageView', 'walkerOS documentation'],\n ['trackGoal', 'goal_1'],\n ],\n};\n\nexport const eventWithGoalValue: Flow.StepExample = {\n title: 'Event with goal value',\n description:\n 'An order complete fires Piwik PRO trackEvent and then trackGoal with the order total as the conversion value.',\n in: getEvent('order complete', { timestamp: 1700000307 }),\n mapping: {\n name: 'trackEvent',\n data: {\n set: [{ value: 'order' }, { value: 'complete' }, 'data.id'],\n },\n settings: {\n goalId: 'goal_1',\n goalValue: 'data.total',\n },\n },\n out: [\n ['trackEvent', 'order', 'complete', '0rd3r1d'],\n ['trackGoal', 'goal_1', 555],\n ],\n};\n\nexport const ecommerceRemoveFromCart: Flow.StepExample = {\n title: 'Remove from cart',\n description:\n 'A product remove fires Piwik PRO ecommerceRemoveFromCart with the removed item.',\n in: getEvent('product remove', {\n timestamp: 1700000308,\n data: {\n id: 'ers',\n name: 'Everyday Ruck Snack',\n color: 'black',\n size: 'l',\n price: 420,\n },\n }),\n mapping: {\n name: 'ecommerceRemoveFromCart',\n data: {\n set: [\n {\n set: [\n {\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n },\n },\n ],\n },\n ],\n },\n },\n out: [\n [\n 'ecommerceRemoveFromCart',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n },\n ],\n ],\n ],\n};\n\nexport const siteSearch: Flow.StepExample = {\n title: 'Site search',\n description:\n 'A search submit fires Piwik PRO trackSiteSearch with the keyword, category, and result count.',\n in: getEvent('search submit', {\n timestamp: 1700000309,\n data: { query: 'rucksack', category: 'bags', results: 12 },\n }),\n mapping: {\n name: 'trackSiteSearch',\n data: {\n set: ['data.query', 'data.category', 'data.results'],\n },\n },\n out: [['trackSiteSearch', 'rucksack', 'bags', 12]],\n};\n\nexport const linkDownload: Flow.StepExample = {\n title: 'Download link',\n description:\n 'A file download fires Piwik PRO trackLink with the file URL and the download link type.',\n in: getEvent('file download', {\n timestamp: 1700000310,\n data: { url: 'https://www.example.com/whitepaper.pdf' },\n }),\n mapping: {\n name: 'trackLink',\n data: {\n set: ['data.url', { value: 'download' }],\n },\n },\n out: [['trackLink', 'https://www.example.com/whitepaper.pdf', 'download']],\n};\n\nexport const ping: Flow.StepExample = {\n title: 'Ping',\n description:\n 'A pulse-triggered event fires Piwik PRO ping to extend the time spent on the page.',\n in: getEvent('page ping', { timestamp: 1700000311, trigger: 'pulse' }),\n mapping: {\n name: 'ping',\n },\n out: [['ping']],\n};\n\nexport const customDimensionsEvent: Flow.StepExample = {\n title: 'Event with custom dimensions',\n description:\n 'A product add fires Piwik PRO trackEvent with rule-level custom dimensions as its dimensions argument, values percent-encoded.',\n in: getEvent('product add', { timestamp: 1700000313 }),\n mapping: {\n name: 'trackEvent',\n data: {\n set: ['entity', 'action', 'data.name', 'data.price'],\n },\n settings: {\n customDimensions: {\n 1: 'data.size',\n 2: 'data.name',\n },\n },\n },\n out: [\n [\n 'trackEvent',\n 'product',\n 'add',\n 'Everyday Ruck Snack',\n 420,\n { dimension1: 'l', dimension2: 'Everyday%20Ruck%20Snack' },\n ],\n ],\n};\n\nexport const customDimensionsPageView: Flow.StepExample = {\n title: 'Page view with custom dimensions',\n description:\n 'trackPageView has no dimensions argument, so rule-level custom dimensions are set right before the hit and deleted right after it.',\n in: getEvent('page view', { timestamp: 1700000314 }),\n mapping: {\n settings: {\n customDimensions: {\n 1: 'globals.pagegroup',\n },\n },\n },\n out: [\n ['setCustomDimensionValue', 1, 'docs'],\n ['trackPageView', 'walkerOS documentation'],\n ['deleteCustomDimension', 1],\n ],\n};\n","import type { Hint } from '@walkeros/core';\n\nexport const hints: Hint.Hints = {\n 'identified-consent': {\n text: 'settings.identified controls identified or anonymous tracking. Absent or true: identified, the Piwik PRO default. false: anonymous from init, without tracker cookies (disableCookies, deleteCookies, setUserIsAnonymous(true)). A consent object like { \"marketing\": true }: anonymous and cookieless until that consent is granted, then enableCookies and deanonymizeUser merge the anonymous session into the identified visitor. Keep config.consent for the states that gate tracking at all and do not repeat the identified states there: a destination needs only one of its config.consent states granted, so next to another state the repeated one lets events through on its own, and as the only state it queues every event until granted, so no anonymous hit is sent.',\n code: [\n {\n lang: 'json',\n code: '{ \"consent\": { \"analytics\": true }, \"settings\": { \"identified\": { \"marketing\": true } } }',\n },\n ],\n },\n 'custom-dimensions': {\n text: 'customDimensions maps bare dimension ids to Mapping Values, at destination level (every hit) and at rule level (wins per key); a dimensions object the mapping passes as the method argument wins over both. trackEvent, trackGoal, trackSiteSearch and trackLink get { \"dimension<id>\": value } as their dimensions argument, values percent-encoded. Every other portable method (trackPageView, the content and ecommerce methods, ping) is wrapped: setCustomDimensionValue before the hit, then rule-only dimensions are deleted and destination values set again, so rule values never leak into automatic hits such as outlinks. Requires Piwik PRO tracker 15.3 or later.',\n code: [\n {\n lang: 'json',\n code: '{ \"settings\": { \"customDimensions\": { \"1\": \"globals.pagegroup\" } }, \"mapping\": { \"product\": { \"add\": { \"name\": \"trackEvent\", \"data\": { \"set\": [\"entity\", \"action\", \"data.name\"] }, \"settings\": { \"customDimensions\": { \"2\": \"data.size\" } } } } } }',\n },\n ],\n },\n 'portable-methods': {\n text: 'rule.name is a Piwik PRO JS API method and data resolves to its positional arguments (an array built with set is spread). The 13 portable methods (trackPageView, trackEvent, trackGoal, trackSiteSearch, trackLink, trackContentImpression, trackContentInteraction, ecommerceProductDetailView, ecommerceAddToCart, ecommerceRemoveFromCart, ecommerceCartUpdate, ecommerceOrder, ping) copy unchanged to the server destination @walkeros/server-destination-piwikpro. Any other _paq command, such as setUserId, works on web by explicit name but is web-only.',\n code: [\n {\n lang: 'json',\n code: '{ \"order\": { \"complete\": { \"name\": \"trackEvent\", \"data\": { \"set\": [\"entity\", \"action\", \"data.id\"] }, \"settings\": { \"goalId\": \"goal-uuid\", \"goalValue\": \"data.total\" } } } }',\n },\n ],\n },\n 'unmapped-events': {\n text: 'An event without a rule name that is not a page view sends only its goal when the rule has settings.goalId, and is otherwise skipped with a warning (once per event name, then at debug level). A named rule with silent: true also sends only its goal. To keep other events out of the destination entirely, ignore everything with a wildcard and keep the page view explicitly.',\n code: [\n {\n lang: 'json',\n code: '{ \"mapping\": { \"*\": { \"*\": { \"ignore\": true } }, \"page\": { \"view\": {} } } }',\n },\n ],\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAA2B;AAE3B,IAAM,EAAE,YAAY,IAAI;AAEjB,IAAM,yBAAyB,aAAE;AAAA,EACtC,aAAE,OAAO,EAAE,MAAM,SAAS,8CAA8C;AAAA,EACxE;AACF;AAEO,IAAM,iBAA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A,IACN,MAAM;AAAA,MACJ;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAAA,EACA,mBAAmB;AAAA,IACjB,MAAM;AAAA,IACN,MAAM;AAAA,MACJ;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;","names":["import_dev","import_dev","init"]}
|
package/dist/dev.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(t,a)=>{for(var i in a)e(t,i,{get:a[i],enumerable:!0})},a={};t(a,{MappingSchema:()=>l,SettingsSchema:()=>d,mapping:()=>u,settings:()=>p});import{zodToSchema as i}from"@walkeros/core/dev";import{schemas as n,z as o}from"@walkeros/core/dev";var{ValueSchema:r}=n,s=o.record(o.string().regex(/^\d+$/,'Dimension keys are bare numeric ids like "1"'),r),d=o.object({appId:o.string().min(1).describe("ID of the Piwik PRO site (like XXX-XXX-XXX-XXX-XXX). Required when loadScript is true").optional(),url:o.string().url().describe("URL of your Piwik PRO account, normalized to one trailing slash (like https://your_account_name.piwik.pro/). Required when loadScript is true").optional(),linkTracking:o.boolean().default(!0).describe("Automatic outlink and download tracking, enabled right after the first hit this destination sends. Default: true"),identified:o.union([o.boolean(),o.record(o.string(),o.boolean())]).describe("Identified or anonymous tracking. true (default) identifies every hit, false switches the tracker to anonymous mode without cookies (disableCookies, deleteCookies, setUserIsAnonymous) at init. A consent object like { marketing: true } identifies only while that consent is granted and calls enableCookies and deanonymizeUser once it is. Do not repeat these states in config.consent, or events are queued and never reach the destination.").optional(),customDimensions:s.describe('Custom dimensions applied to every hit, keyed by bare dimension id (like { "1": "data.size" }). Rule-level customDimensions win per key.').optional()});import{schemas as c,z as m}from"@walkeros/core/dev";var l=m.object({goalId:m.union([m.string(),m.number()]).describe("Piwik PRO goal id (UUID or legacy integer). Adds a second hit, trackGoal.").optional(),goalValue:c.ValueSchema.describe('Goal revenue, resolved from the event (like "data.total"), passed as the trackGoal conversion value').optional(),customDimensions:s.describe('Custom dimensions for this rule, keyed by bare dimension id (like { "1": "data.size" }). Wins per key over the destination customDimensions.').optional()}),p=i(d),u=i(l),k={};t(k,{env:()=>g,step:()=>y});var g={};t(g,{init:()=>h,push:()=>v,simulation:()=>w});var h={window:{},document:{createElement:()=>({type:"",src:"",async:!1,defer:!1}),head:{appendChild:()=>{}}}},v={window:{_paq:[]},document:{createElement:()=>({type:"",src:"",async:!1,defer:!1}),head:{appendChild:()=>{}}}},w=["call:window._paq.push"],y={};t(y,{cartUpdate:()=>C,customDimensionsEvent:()=>U,customDimensionsPageView:()=>x,customEvent:()=>A,ecommerceAddToCart:()=>D,ecommerceOrder:()=>R,ecommerceRemoveFromCart:()=>q,eventWithGoalValue:()=>V,init:()=>P,linkDownload:()=>_,linkTrackingAfterFirstHit:()=>X,pageViewWithGoal:()=>O,pageViewWithTitle:()=>E,ping:()=>T,productDetailView:()=>S,siteSearch:()=>I});import{getEvent as f,isObject as b}from"@walkeros/core";var P={title:"Initialization",description:"Destination bootstrap loads the Piwik PRO tracker and configures the tracker URL and app id.",in:{loadScript:!0,settings:{appId:"XXX-XXX-XXX-XXX-XXX",url:"https://your_account_name.piwik.pro/"}},out:[["_paq.push",["setTrackerUrl","https://your_account_name.piwik.pro/ppms.php"]],["_paq.push",["setSiteId","XXX-XXX-XXX-XXX-XXX"]]]},X={title:"Link tracking after the first hit",description:"With the default linkTracking setting, the first hit is followed by enableLinkTracking for automatic outlink and download tracking.",in:f("page view",{timestamp:1700000312}),out:[["trackPageView","walkerOS documentation"],["enableLinkTracking"]]},R={title:"Ecommerce order",description:"A completed order calls Piwik PRO ecommerceOrder with line items and order totals.",in:f("order complete",{timestamp:1700000300}),mapping:{name:"ecommerceOrder",data:{set:[{loop:["nested",{condition:e=>b(e)&&"product"===e.entity,map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"},customDimensions:{map:{1:"data.size"}}}}]},{map:{orderId:"data.id",grandTotal:"data.total",tax:"data.taxes",shipping:"data.shipping"}}]}},out:[["ecommerceOrder",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black",customDimensions:{1:"l"}},{sku:"cc",name:"Cool Cap",price:42,quantity:1,customDimensions:{1:"one size"}}],{orderId:"0rd3r1d",grandTotal:555,tax:73.76,shipping:5.22}]]},D={title:"Add to cart",description:"A product add fires Piwik PRO ecommerceAddToCart with the added item.",in:f("product add",{timestamp:1700000301}),mapping:{name:"ecommerceAddToCart",data:{set:[{set:[{map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"},customDimensions:{map:{1:"data.size"}}}}]}]}},out:[["ecommerceAddToCart",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black",customDimensions:{1:"l"}}]]]},S={title:"Product detail view",description:"A product view fires Piwik PRO ecommerceProductDetailView with a single-item array.",in:f("product view",{timestamp:1700000302}),mapping:{name:"ecommerceProductDetailView",data:{set:[{set:[{map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"},customDimensions:{map:{1:"data.size"}}}}]}]}},out:[["ecommerceProductDetailView",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black",customDimensions:{1:"l"}}]]]},C={title:"Cart update",description:"A cart view fires Piwik PRO ecommerceCartUpdate with nested products and the cart total.",in:f("cart view",{timestamp:1700000303}),mapping:{name:"ecommerceCartUpdate",data:{set:[{loop:["nested",{condition:e=>b(e)&&"product"===e.entity,map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"},customDimensions:{map:{1:"data.size"}}}}]},"data.value"]}},out:[["ecommerceCartUpdate",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black",customDimensions:{1:"l"}}],840]]},A={title:"Custom event with goal",description:"A promotion visible event fires Piwik PRO trackEvent and then trackGoal to record a goal conversion.",in:f("promotion visible",{timestamp:1700000304}),mapping:{name:"trackEvent",settings:{goalId:"goal_1"},data:{set:["data.name","data.position"]}},out:[["trackEvent","Setting up tracking easily","hero"],["trackGoal","goal_1"]]},E={title:"Page view",description:"A page view fires Piwik PRO trackPageView with the page title resolved from event data.",in:f("page view",{timestamp:1700000305}),mapping:{data:"data.title"},out:[["trackPageView","walkerOS documentation"]]},O={title:"Page view with goal",description:"A page view rule with a goal keeps the default trackPageView and adds a trackGoal conversion.",in:f("page view",{timestamp:1700000306}),mapping:{settings:{goalId:"goal_1"}},out:[["trackPageView","walkerOS documentation"],["trackGoal","goal_1"]]},V={title:"Event with goal value",description:"An order complete fires Piwik PRO trackEvent and then trackGoal with the order total as the conversion value.",in:f("order complete",{timestamp:1700000307}),mapping:{name:"trackEvent",data:{set:[{value:"order"},{value:"complete"},"data.id"]},settings:{goalId:"goal_1",goalValue:"data.total"}},out:[["trackEvent","order","complete","0rd3r1d"],["trackGoal","goal_1",555]]},q={title:"Remove from cart",description:"A product remove fires Piwik PRO ecommerceRemoveFromCart with the removed item.",in:f("product remove",{timestamp:1700000308,data:{id:"ers",name:"Everyday Ruck Snack",color:"black",size:"l",price:420}}),mapping:{name:"ecommerceRemoveFromCart",data:{set:[{set:[{map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"}}}]}]}},out:[["ecommerceRemoveFromCart",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black"}]]]},I={title:"Site search",description:"A search submit fires Piwik PRO trackSiteSearch with the keyword, category, and result count.",in:f("search submit",{timestamp:1700000309,data:{query:"rucksack",category:"bags",results:12}}),mapping:{name:"trackSiteSearch",data:{set:["data.query","data.category","data.results"]}},out:[["trackSiteSearch","rucksack","bags",12]]},_={title:"Download link",description:"A file download fires Piwik PRO trackLink with the file URL and the download link type.",in:f("file download",{timestamp:1700000310,data:{url:"https://www.example.com/whitepaper.pdf"}}),mapping:{name:"trackLink",data:{set:["data.url",{value:"download"}]}},out:[["trackLink","https://www.example.com/whitepaper.pdf","download"]]},T={title:"Ping",description:"A pulse-triggered event fires Piwik PRO ping to extend the time spent on the page.",in:f("page ping",{timestamp:1700000311,trigger:"pulse"}),mapping:{name:"ping"},out:[["ping"]]},U={title:"Event with custom dimensions",description:"A product add fires Piwik PRO trackEvent with rule-level custom dimensions as its dimensions argument, values percent-encoded.",in:f("product add",{timestamp:1700000313}),mapping:{name:"trackEvent",data:{set:["entity","action","data.name","data.price"]},settings:{customDimensions:{1:"data.size",2:"data.name"}}},out:[["trackEvent","product","add","Everyday Ruck Snack",420,{dimension1:"l",dimension2:"Everyday%20Ruck%20Snack"}]]},x={title:"Page view with custom dimensions",description:"trackPageView has no dimensions argument, so rule-level custom dimensions are set right before the hit and deleted right after it.",in:f("page view",{timestamp:1700000314}),mapping:{settings:{customDimensions:{1:"globals.pagegroup"}}},out:[["setCustomDimensionValue",1,"docs"],["trackPageView","walkerOS documentation"],["deleteCustomDimension",1]]},z={"identified-consent":{text:'settings.identified controls identified or anonymous tracking. Absent or true: identified, the Piwik PRO default. false: anonymous from init, without tracker cookies (disableCookies, deleteCookies, setUserIsAnonymous(true)). A consent object like { "marketing": true }: anonymous and cookieless until that consent is granted, then enableCookies and deanonymizeUser merge the anonymous session into the identified visitor. Keep config.consent for the states that gate tracking at all; do not repeat the identified states there, or events are queued and never reach the destination.',code:[{lang:"json",code:'{ "consent": { "analytics": true }, "settings": { "identified": { "marketing": true } } }'}]},"custom-dimensions":{text:'customDimensions maps bare dimension ids to Mapping Values, at destination level (every hit) and at rule level (wins per key); a dimensions object the mapping passes as the method argument wins over both. trackEvent, trackGoal, trackSiteSearch and trackLink get { "dimension<id>": value } as their dimensions argument, values percent-encoded. Every other portable method (trackPageView, the content and ecommerce methods, ping) is wrapped: setCustomDimensionValue before the hit, then rule-only dimensions are deleted and destination values set again, so rule values never leak into automatic hits such as outlinks. Requires Piwik PRO tracker 15.3 or later.',code:[{lang:"json",code:'{ "settings": { "customDimensions": { "1": "globals.pagegroup" } }, "mapping": { "product": { "add": { "name": "trackEvent", "data": { "set": ["entity", "action", "data.name"] }, "settings": { "customDimensions": { "2": "data.size" } } } } } }'}]},"portable-methods":{text:"rule.name is a Piwik PRO JS API method and data resolves to its positional arguments (an array built with set is spread). The 13 portable methods (trackPageView, trackEvent, trackGoal, trackSiteSearch, trackLink, trackContentImpression, trackContentInteraction, ecommerceProductDetailView, ecommerceAddToCart, ecommerceRemoveFromCart, ecommerceCartUpdate, ecommerceOrder, ping) copy unchanged to the server destination @walkeros/server-destination-piwikpro. Any other _paq command, such as setUserId, works on web by explicit name but is web-only.",code:[{lang:"json",code:'{ "order": { "complete": { "name": "trackEvent", "data": { "set": ["entity", "action", "data.id"] }, "settings": { "goalId": "goal-uuid", "goalValue": "data.total" } } } }'}]},"unmapped-events":{text:"An event without a rule name that is not a page view sends only its goal when the rule has settings.goalId, and is otherwise skipped with a warning (once per event name, then at debug level). A named rule with silent: true also sends only its goal. To keep other events out of the destination entirely, ignore everything with a wildcard and keep the page view explicitly.",code:[{lang:"json",code:'{ "mapping": { "*": { "*": { "ignore": true } }, "page": { "view": {} } } }'}]}};export{k as examples,z as hints,a as schemas};//# sourceMappingURL=dev.mjs.map
|
|
1
|
+
var e=Object.defineProperty,t=(t,a)=>{for(var i in a)e(t,i,{get:a[i],enumerable:!0})},a={};t(a,{MappingSchema:()=>l,SettingsSchema:()=>d,mapping:()=>u,settings:()=>p});import{zodToSchema as i}from"@walkeros/core/dev";import{schemas as n,z as o}from"@walkeros/core/dev";var{ValueSchema:r}=n,s=o.record(o.string().regex(/^\d+$/,'Dimension keys are bare numeric ids like "1"'),r),d=o.object({appId:o.string().min(1).describe("ID of the Piwik PRO site (like XXX-XXX-XXX-XXX-XXX). Required when loadScript is true").optional(),url:o.string().url().describe("URL of your Piwik PRO account, normalized to one trailing slash (like https://your_account_name.piwik.pro/). Required when loadScript is true").optional(),linkTracking:o.boolean().default(!0).describe("Automatic outlink and download tracking, enabled right after the first hit this destination sends. Default: true"),identified:o.union([o.boolean(),o.record(o.string(),o.boolean())]).describe("Identified or anonymous tracking. true (default) identifies every hit, false switches the tracker to anonymous mode without cookies (disableCookies, deleteCookies, setUserIsAnonymous) at init. A consent object like { marketing: true } identifies only while that consent is granted and calls enableCookies and deanonymizeUser once it is. Do not repeat these states in config.consent: a destination needs only one of its config.consent states granted, so next to another state the repeated one lets events through on its own, and as the only state it queues every event until granted, so no anonymous hit is sent.").optional(),customDimensions:s.describe('Custom dimensions applied to every hit, keyed by bare dimension id (like { "1": "data.size" }). Rule-level customDimensions win per key.').optional()});import{schemas as c,z as m}from"@walkeros/core/dev";var l=m.object({goalId:m.union([m.string(),m.number()]).describe("Piwik PRO goal id (UUID or legacy integer). Adds a second hit, trackGoal.").optional(),goalValue:c.ValueSchema.describe('Goal revenue, resolved from the event (like "data.total"), passed as the trackGoal conversion value').optional(),customDimensions:s.describe('Custom dimensions for this rule, keyed by bare dimension id (like { "1": "data.size" }). Wins per key over the destination customDimensions.').optional()}),p=i(d),u=i(l),k={};t(k,{env:()=>g,step:()=>y});var g={};t(g,{init:()=>h,push:()=>v,simulation:()=>w});var h={window:{},document:{createElement:()=>({type:"",src:"",async:!1,defer:!1}),head:{appendChild:()=>{}}}},v={window:{_paq:[]},document:{createElement:()=>({type:"",src:"",async:!1,defer:!1}),head:{appendChild:()=>{}}}},w=["call:window._paq.push"],y={};t(y,{cartUpdate:()=>S,customDimensionsEvent:()=>_,customDimensionsPageView:()=>T,customEvent:()=>C,ecommerceAddToCart:()=>R,ecommerceOrder:()=>X,ecommerceRemoveFromCart:()=>V,eventWithGoalValue:()=>O,init:()=>b,linkDownload:()=>I,linkTrackingAfterFirstHit:()=>P,pageViewWithGoal:()=>E,pageViewWithTitle:()=>A,ping:()=>x,productDetailView:()=>D,siteSearch:()=>q});import{getEvent as f}from"@walkeros/core";var b={title:"Initialization",description:"Destination bootstrap loads the Piwik PRO tracker and configures the tracker URL and app id.",in:{loadScript:!0,settings:{appId:"XXX-XXX-XXX-XXX-XXX",url:"https://your_account_name.piwik.pro/"}},out:[["_paq.push",["setTrackerUrl","https://your_account_name.piwik.pro/ppms.php"]],["_paq.push",["setSiteId","XXX-XXX-XXX-XXX-XXX"]]]},P={title:"Link tracking after the first hit",description:"With the default linkTracking setting, the first hit is followed by enableLinkTracking for automatic outlink and download tracking.",in:f("page view",{timestamp:1700000312}),out:[["trackPageView","walkerOS documentation"],["enableLinkTracking"]]},X={title:"Ecommerce order",description:"A completed order calls Piwik PRO ecommerceOrder with line items and order totals.",in:f("order complete",{timestamp:1700000300}),mapping:{name:"ecommerceOrder",data:{set:[{loop:["nested",{condition:e=>"object"==typeof e&&null!==e&&"entity"in e&&"product"===e.entity,map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"},customDimensions:{map:{1:"data.size"}}}}]},{map:{orderId:"data.id",grandTotal:"data.total",tax:"data.taxes",shipping:"data.shipping"}}]}},out:[["ecommerceOrder",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black",customDimensions:{1:"l"}},{sku:"cc",name:"Cool Cap",price:42,quantity:1,customDimensions:{1:"one size"}}],{orderId:"0rd3r1d",grandTotal:555,tax:73.76,shipping:5.22}]]},R={title:"Add to cart",description:"A product add fires Piwik PRO ecommerceAddToCart with the added item.",in:f("product add",{timestamp:1700000301}),mapping:{name:"ecommerceAddToCart",data:{set:[{set:[{map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"},customDimensions:{map:{1:"data.size"}}}}]}]}},out:[["ecommerceAddToCart",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black",customDimensions:{1:"l"}}]]]},D={title:"Product detail view",description:"A product view fires Piwik PRO ecommerceProductDetailView with a single-item array.",in:f("product view",{timestamp:1700000302}),mapping:{name:"ecommerceProductDetailView",data:{set:[{set:[{map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"},customDimensions:{map:{1:"data.size"}}}}]}]}},out:[["ecommerceProductDetailView",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black",customDimensions:{1:"l"}}]]]},S={title:"Cart update",description:"A cart view fires Piwik PRO ecommerceCartUpdate with nested products and the cart total.",in:f("cart view",{timestamp:1700000303}),mapping:{name:"ecommerceCartUpdate",data:{set:[{loop:["nested",{condition:e=>"object"==typeof e&&null!==e&&"entity"in e&&"product"===e.entity,map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"},customDimensions:{map:{1:"data.size"}}}}]},"data.value"]}},out:[["ecommerceCartUpdate",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black",customDimensions:{1:"l"}}],840]]},C={title:"Custom event with goal",description:"A promotion visible event fires Piwik PRO trackEvent and then trackGoal to record a goal conversion.",in:f("promotion visible",{timestamp:1700000304}),mapping:{name:"trackEvent",settings:{goalId:"goal_1"},data:{set:["data.name","data.position"]}},out:[["trackEvent","Setting up tracking easily","hero"],["trackGoal","goal_1"]]},A={title:"Page view",description:"A page view fires Piwik PRO trackPageView with the page title resolved from event data.",in:f("page view",{timestamp:1700000305}),mapping:{data:"data.title"},out:[["trackPageView","walkerOS documentation"]]},E={title:"Page view with goal",description:"A page view rule with a goal keeps the default trackPageView and adds a trackGoal conversion.",in:f("page view",{timestamp:1700000306}),mapping:{settings:{goalId:"goal_1"}},out:[["trackPageView","walkerOS documentation"],["trackGoal","goal_1"]]},O={title:"Event with goal value",description:"An order complete fires Piwik PRO trackEvent and then trackGoal with the order total as the conversion value.",in:f("order complete",{timestamp:1700000307}),mapping:{name:"trackEvent",data:{set:[{value:"order"},{value:"complete"},"data.id"]},settings:{goalId:"goal_1",goalValue:"data.total"}},out:[["trackEvent","order","complete","0rd3r1d"],["trackGoal","goal_1",555]]},V={title:"Remove from cart",description:"A product remove fires Piwik PRO ecommerceRemoveFromCart with the removed item.",in:f("product remove",{timestamp:1700000308,data:{id:"ers",name:"Everyday Ruck Snack",color:"black",size:"l",price:420}}),mapping:{name:"ecommerceRemoveFromCart",data:{set:[{set:[{map:{sku:"data.id",name:"data.name",price:"data.price",quantity:{value:1},variant:{key:"data.color"}}}]}]}},out:[["ecommerceRemoveFromCart",[{sku:"ers",name:"Everyday Ruck Snack",price:420,quantity:1,variant:"black"}]]]},q={title:"Site search",description:"A search submit fires Piwik PRO trackSiteSearch with the keyword, category, and result count.",in:f("search submit",{timestamp:1700000309,data:{query:"rucksack",category:"bags",results:12}}),mapping:{name:"trackSiteSearch",data:{set:["data.query","data.category","data.results"]}},out:[["trackSiteSearch","rucksack","bags",12]]},I={title:"Download link",description:"A file download fires Piwik PRO trackLink with the file URL and the download link type.",in:f("file download",{timestamp:1700000310,data:{url:"https://www.example.com/whitepaper.pdf"}}),mapping:{name:"trackLink",data:{set:["data.url",{value:"download"}]}},out:[["trackLink","https://www.example.com/whitepaper.pdf","download"]]},x={title:"Ping",description:"A pulse-triggered event fires Piwik PRO ping to extend the time spent on the page.",in:f("page ping",{timestamp:1700000311,trigger:"pulse"}),mapping:{name:"ping"},out:[["ping"]]},_={title:"Event with custom dimensions",description:"A product add fires Piwik PRO trackEvent with rule-level custom dimensions as its dimensions argument, values percent-encoded.",in:f("product add",{timestamp:1700000313}),mapping:{name:"trackEvent",data:{set:["entity","action","data.name","data.price"]},settings:{customDimensions:{1:"data.size",2:"data.name"}}},out:[["trackEvent","product","add","Everyday Ruck Snack",420,{dimension1:"l",dimension2:"Everyday%20Ruck%20Snack"}]]},T={title:"Page view with custom dimensions",description:"trackPageView has no dimensions argument, so rule-level custom dimensions are set right before the hit and deleted right after it.",in:f("page view",{timestamp:1700000314}),mapping:{settings:{customDimensions:{1:"globals.pagegroup"}}},out:[["setCustomDimensionValue",1,"docs"],["trackPageView","walkerOS documentation"],["deleteCustomDimension",1]]},U={"identified-consent":{text:'settings.identified controls identified or anonymous tracking. Absent or true: identified, the Piwik PRO default. false: anonymous from init, without tracker cookies (disableCookies, deleteCookies, setUserIsAnonymous(true)). A consent object like { "marketing": true }: anonymous and cookieless until that consent is granted, then enableCookies and deanonymizeUser merge the anonymous session into the identified visitor. Keep config.consent for the states that gate tracking at all and do not repeat the identified states there: a destination needs only one of its config.consent states granted, so next to another state the repeated one lets events through on its own, and as the only state it queues every event until granted, so no anonymous hit is sent.',code:[{lang:"json",code:'{ "consent": { "analytics": true }, "settings": { "identified": { "marketing": true } } }'}]},"custom-dimensions":{text:'customDimensions maps bare dimension ids to Mapping Values, at destination level (every hit) and at rule level (wins per key); a dimensions object the mapping passes as the method argument wins over both. trackEvent, trackGoal, trackSiteSearch and trackLink get { "dimension<id>": value } as their dimensions argument, values percent-encoded. Every other portable method (trackPageView, the content and ecommerce methods, ping) is wrapped: setCustomDimensionValue before the hit, then rule-only dimensions are deleted and destination values set again, so rule values never leak into automatic hits such as outlinks. Requires Piwik PRO tracker 15.3 or later.',code:[{lang:"json",code:'{ "settings": { "customDimensions": { "1": "globals.pagegroup" } }, "mapping": { "product": { "add": { "name": "trackEvent", "data": { "set": ["entity", "action", "data.name"] }, "settings": { "customDimensions": { "2": "data.size" } } } } } }'}]},"portable-methods":{text:"rule.name is a Piwik PRO JS API method and data resolves to its positional arguments (an array built with set is spread). The 13 portable methods (trackPageView, trackEvent, trackGoal, trackSiteSearch, trackLink, trackContentImpression, trackContentInteraction, ecommerceProductDetailView, ecommerceAddToCart, ecommerceRemoveFromCart, ecommerceCartUpdate, ecommerceOrder, ping) copy unchanged to the server destination @walkeros/server-destination-piwikpro. Any other _paq command, such as setUserId, works on web by explicit name but is web-only.",code:[{lang:"json",code:'{ "order": { "complete": { "name": "trackEvent", "data": { "set": ["entity", "action", "data.id"] }, "settings": { "goalId": "goal-uuid", "goalValue": "data.total" } } } }'}]},"unmapped-events":{text:"An event without a rule name that is not a page view sends only its goal when the rule has settings.goalId, and is otherwise skipped with a warning (once per event name, then at debug level). A named rule with silent: true also sends only its goal. To keep other events out of the destination entirely, ignore everything with a wildcard and keep the page view explicitly.",code:[{lang:"json",code:'{ "mapping": { "*": { "*": { "ignore": true } }, "page": { "view": {} } } }'}]}};export{k as examples,U as hints,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","../src/hints.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\n// Types of record live in ../types; the zod types loosen through core's ValueSchema\nexport { SettingsSchema } from './settings';\nexport { MappingSchema } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { schemas, z } from '@walkeros/core/dev';\n\nconst { ValueSchema } = schemas;\n\nexport const CustomDimensionsSchema = z.record(\n z.string().regex(/^\\d+$/, 'Dimension keys are bare numeric ids like \"1\"'),\n ValueSchema,\n);\n\nexport const SettingsSchema = z.object({\n appId: z\n .string()\n .min(1)\n .describe(\n 'ID of the Piwik PRO site (like XXX-XXX-XXX-XXX-XXX). Required when loadScript is true',\n )\n .optional(),\n url: z\n .string()\n .url()\n .describe(\n 'URL of your Piwik PRO account, normalized to one trailing slash (like https://your_account_name.piwik.pro/). Required when loadScript is true',\n )\n .optional(),\n linkTracking: z\n .boolean()\n .default(true)\n .describe(\n 'Automatic outlink and download tracking, enabled right after the first hit this destination sends. Default: true',\n ),\n identified: z\n .union([z.boolean(), z.record(z.string(), z.boolean())])\n .describe(\n 'Identified or anonymous tracking. true (default) identifies every hit, false switches the tracker to anonymous mode without cookies (disableCookies, deleteCookies, setUserIsAnonymous) at init. A consent object like { marketing: true } identifies only while that consent is granted and calls enableCookies and deanonymizeUser once it is. Do not repeat these states in config.consent, or events are queued and never reach the destination.',\n )\n .optional(),\n customDimensions: CustomDimensionsSchema.describe(\n 'Custom dimensions applied to every hit, keyed by bare dimension id (like { \"1\": \"data.size\" }). Rule-level customDimensions win per key.',\n ).optional(),\n});\n","import { schemas, z } from '@walkeros/core/dev';\nimport { CustomDimensionsSchema } from './settings';\n\nexport const MappingSchema = z.object({\n goalId: z\n .union([z.string(), z.number()])\n .describe(\n 'Piwik PRO goal id (UUID or legacy integer). Adds a second hit, trackGoal.',\n )\n .optional(),\n goalValue: schemas.ValueSchema.describe(\n 'Goal revenue, resolved from the event (like \"data.total\"), passed as the trackGoal conversion value',\n ).optional(),\n customDimensions: CustomDimensionsSchema.describe(\n 'Custom dimensions for this rule, keyed by bare dimension id (like { \"1\": \"data.size\" }). Wins per key over the destination customDimensions.',\n ).optional(),\n});\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for PiwikPro destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring external dependencies.\n */\n\nexport const init: Env | undefined = {\n window: {\n // _paq absent: init() is expected to install the queue.\n },\n document: {\n createElement: () => ({\n type: '',\n src: '',\n async: false,\n defer: false,\n }),\n head: { appendChild: () => {} },\n },\n};\n\nexport const push: Env = {\n window: {\n _paq: [],\n },\n document: {\n createElement: () => ({\n type: '',\n src: '',\n async: false,\n defer: false,\n }),\n head: { appendChild: () => {} },\n },\n};\n\n/**\n * Simulation tracking paths\n * Specifies which function calls to track during simulation\n */\nexport const simulation = [\n 'call:window._paq.push', // Track _paq.push calls\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent, isObject } from '@walkeros/core';\n\n/**\n * Destination bootstrap.\n * Given the canonical settings, init loads the PiwikPro script and configures\n * the tracker URL and app id. Link tracking follows the first hit instead\n * (see `linkTrackingAfterFirstHit`). Reproduce by passing the same settings to\n * `startFlow` as the destination config.\n */\nexport const init: Flow.StepExample = {\n title: 'Initialization',\n description:\n 'Destination bootstrap loads the Piwik PRO tracker and configures the tracker URL and app id.',\n in: {\n loadScript: true,\n settings: {\n appId: 'XXX-XXX-XXX-XXX-XXX',\n url: 'https://your_account_name.piwik.pro/',\n },\n },\n out: [\n [\n '_paq.push',\n ['setTrackerUrl', 'https://your_account_name.piwik.pro/ppms.php'],\n ],\n ['_paq.push', ['setSiteId', 'XXX-XXX-XXX-XXX-XXX']],\n ],\n};\n\n/**\n * Runs with the default settings (linkTracking on). The other event examples\n * run with `linkTracking: false`, so their `out` holds only their own commands.\n */\nexport const linkTrackingAfterFirstHit: Flow.StepExample = {\n title: 'Link tracking after the first hit',\n description:\n 'With the default linkTracking setting, the first hit is followed by enableLinkTracking for automatic outlink and download tracking.',\n in: getEvent('page view', { timestamp: 1700000312 }),\n out: [['trackPageView', 'walkerOS documentation'], ['enableLinkTracking']],\n};\n\nexport const ecommerceOrder: Flow.StepExample = {\n title: 'Ecommerce order',\n description:\n 'A completed order calls Piwik PRO ecommerceOrder with line items and order totals.',\n in: getEvent('order complete', { timestamp: 1700000300 }),\n mapping: {\n name: 'ecommerceOrder',\n data: {\n set: [\n {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n customDimensions: {\n map: {\n 1: 'data.size',\n },\n },\n },\n },\n ],\n },\n {\n map: {\n orderId: 'data.id',\n grandTotal: 'data.total',\n tax: 'data.taxes',\n shipping: 'data.shipping',\n },\n },\n ],\n },\n },\n out: [\n [\n 'ecommerceOrder',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n customDimensions: { 1: 'l' },\n },\n {\n sku: 'cc',\n name: 'Cool Cap',\n price: 42,\n quantity: 1,\n customDimensions: { 1: 'one size' },\n },\n ],\n {\n orderId: '0rd3r1d',\n grandTotal: 555,\n tax: 73.76,\n shipping: 5.22,\n },\n ],\n ],\n};\n\nexport const ecommerceAddToCart: Flow.StepExample = {\n title: 'Add to cart',\n description:\n 'A product add fires Piwik PRO ecommerceAddToCart with the added item.',\n in: getEvent('product add', { timestamp: 1700000301 }),\n mapping: {\n name: 'ecommerceAddToCart',\n data: {\n set: [\n {\n set: [\n {\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n customDimensions: {\n map: {\n 1: 'data.size',\n },\n },\n },\n },\n ],\n },\n ],\n },\n },\n out: [\n [\n 'ecommerceAddToCart',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n customDimensions: { 1: 'l' },\n },\n ],\n ],\n ],\n};\n\nexport const productDetailView: Flow.StepExample = {\n title: 'Product detail view',\n description:\n 'A product view fires Piwik PRO ecommerceProductDetailView with a single-item array.',\n in: getEvent('product view', { timestamp: 1700000302 }),\n mapping: {\n name: 'ecommerceProductDetailView',\n data: {\n set: [\n {\n set: [\n {\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n customDimensions: {\n map: {\n 1: 'data.size',\n },\n },\n },\n },\n ],\n },\n ],\n },\n },\n out: [\n [\n 'ecommerceProductDetailView',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n customDimensions: { 1: 'l' },\n },\n ],\n ],\n ],\n};\n\nexport const cartUpdate: Flow.StepExample = {\n title: 'Cart update',\n description:\n 'A cart view fires Piwik PRO ecommerceCartUpdate with nested products and the cart total.',\n in: getEvent('cart view', { timestamp: 1700000303 }),\n mapping: {\n name: 'ecommerceCartUpdate',\n data: {\n set: [\n {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n customDimensions: {\n map: {\n 1: 'data.size',\n },\n },\n },\n },\n ],\n },\n 'data.value',\n ],\n },\n },\n out: [\n [\n 'ecommerceCartUpdate',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n customDimensions: { 1: 'l' },\n },\n ],\n 840,\n ],\n ],\n};\n\nexport const customEvent: Flow.StepExample = {\n title: 'Custom event with goal',\n description:\n 'A promotion visible event fires Piwik PRO trackEvent and then trackGoal to record a goal conversion.',\n in: getEvent('promotion visible', { timestamp: 1700000304 }),\n mapping: {\n name: 'trackEvent',\n settings: {\n goalId: 'goal_1',\n },\n data: {\n set: ['data.name', 'data.position'],\n },\n },\n out: [\n ['trackEvent', 'Setting up tracking easily', 'hero'],\n ['trackGoal', 'goal_1'],\n ],\n};\n\nexport const pageViewWithTitle: Flow.StepExample = {\n title: 'Page view',\n description:\n 'A page view fires Piwik PRO trackPageView with the page title resolved from event data.',\n in: getEvent('page view', { timestamp: 1700000305 }),\n mapping: {\n data: 'data.title',\n },\n out: [['trackPageView', 'walkerOS documentation']],\n};\n\nexport const pageViewWithGoal: Flow.StepExample = {\n title: 'Page view with goal',\n description:\n 'A page view rule with a goal keeps the default trackPageView and adds a trackGoal conversion.',\n in: getEvent('page view', { timestamp: 1700000306 }),\n mapping: {\n settings: {\n goalId: 'goal_1',\n },\n },\n out: [\n ['trackPageView', 'walkerOS documentation'],\n ['trackGoal', 'goal_1'],\n ],\n};\n\nexport const eventWithGoalValue: Flow.StepExample = {\n title: 'Event with goal value',\n description:\n 'An order complete fires Piwik PRO trackEvent and then trackGoal with the order total as the conversion value.',\n in: getEvent('order complete', { timestamp: 1700000307 }),\n mapping: {\n name: 'trackEvent',\n data: {\n set: [{ value: 'order' }, { value: 'complete' }, 'data.id'],\n },\n settings: {\n goalId: 'goal_1',\n goalValue: 'data.total',\n },\n },\n out: [\n ['trackEvent', 'order', 'complete', '0rd3r1d'],\n ['trackGoal', 'goal_1', 555],\n ],\n};\n\nexport const ecommerceRemoveFromCart: Flow.StepExample = {\n title: 'Remove from cart',\n description:\n 'A product remove fires Piwik PRO ecommerceRemoveFromCart with the removed item.',\n in: getEvent('product remove', {\n timestamp: 1700000308,\n data: {\n id: 'ers',\n name: 'Everyday Ruck Snack',\n color: 'black',\n size: 'l',\n price: 420,\n },\n }),\n mapping: {\n name: 'ecommerceRemoveFromCart',\n data: {\n set: [\n {\n set: [\n {\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n },\n },\n ],\n },\n ],\n },\n },\n out: [\n [\n 'ecommerceRemoveFromCart',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n },\n ],\n ],\n ],\n};\n\nexport const siteSearch: Flow.StepExample = {\n title: 'Site search',\n description:\n 'A search submit fires Piwik PRO trackSiteSearch with the keyword, category, and result count.',\n in: getEvent('search submit', {\n timestamp: 1700000309,\n data: { query: 'rucksack', category: 'bags', results: 12 },\n }),\n mapping: {\n name: 'trackSiteSearch',\n data: {\n set: ['data.query', 'data.category', 'data.results'],\n },\n },\n out: [['trackSiteSearch', 'rucksack', 'bags', 12]],\n};\n\nexport const linkDownload: Flow.StepExample = {\n title: 'Download link',\n description:\n 'A file download fires Piwik PRO trackLink with the file URL and the download link type.',\n in: getEvent('file download', {\n timestamp: 1700000310,\n data: { url: 'https://www.example.com/whitepaper.pdf' },\n }),\n mapping: {\n name: 'trackLink',\n data: {\n set: ['data.url', { value: 'download' }],\n },\n },\n out: [['trackLink', 'https://www.example.com/whitepaper.pdf', 'download']],\n};\n\nexport const ping: Flow.StepExample = {\n title: 'Ping',\n description:\n 'A pulse-triggered event fires Piwik PRO ping to extend the time spent on the page.',\n in: getEvent('page ping', { timestamp: 1700000311, trigger: 'pulse' }),\n mapping: {\n name: 'ping',\n },\n out: [['ping']],\n};\n\nexport const customDimensionsEvent: Flow.StepExample = {\n title: 'Event with custom dimensions',\n description:\n 'A product add fires Piwik PRO trackEvent with rule-level custom dimensions as its dimensions argument, values percent-encoded.',\n in: getEvent('product add', { timestamp: 1700000313 }),\n mapping: {\n name: 'trackEvent',\n data: {\n set: ['entity', 'action', 'data.name', 'data.price'],\n },\n settings: {\n customDimensions: {\n 1: 'data.size',\n 2: 'data.name',\n },\n },\n },\n out: [\n [\n 'trackEvent',\n 'product',\n 'add',\n 'Everyday Ruck Snack',\n 420,\n { dimension1: 'l', dimension2: 'Everyday%20Ruck%20Snack' },\n ],\n ],\n};\n\nexport const customDimensionsPageView: Flow.StepExample = {\n title: 'Page view with custom dimensions',\n description:\n 'trackPageView has no dimensions argument, so rule-level custom dimensions are set right before the hit and deleted right after it.',\n in: getEvent('page view', { timestamp: 1700000314 }),\n mapping: {\n settings: {\n customDimensions: {\n 1: 'globals.pagegroup',\n },\n },\n },\n out: [\n ['setCustomDimensionValue', 1, 'docs'],\n ['trackPageView', 'walkerOS documentation'],\n ['deleteCustomDimension', 1],\n ],\n};\n","import type { Hint } from '@walkeros/core';\n\nexport const hints: Hint.Hints = {\n 'identified-consent': {\n text: 'settings.identified controls identified or anonymous tracking. Absent or true: identified, the Piwik PRO default. false: anonymous from init, without tracker cookies (disableCookies, deleteCookies, setUserIsAnonymous(true)). A consent object like { \"marketing\": true }: anonymous and cookieless until that consent is granted, then enableCookies and deanonymizeUser merge the anonymous session into the identified visitor. Keep config.consent for the states that gate tracking at all; do not repeat the identified states there, or events are queued and never reach the destination.',\n code: [\n {\n lang: 'json',\n code: '{ \"consent\": { \"analytics\": true }, \"settings\": { \"identified\": { \"marketing\": true } } }',\n },\n ],\n },\n 'custom-dimensions': {\n text: 'customDimensions maps bare dimension ids to Mapping Values, at destination level (every hit) and at rule level (wins per key); a dimensions object the mapping passes as the method argument wins over both. trackEvent, trackGoal, trackSiteSearch and trackLink get { \"dimension<id>\": value } as their dimensions argument, values percent-encoded. Every other portable method (trackPageView, the content and ecommerce methods, ping) is wrapped: setCustomDimensionValue before the hit, then rule-only dimensions are deleted and destination values set again, so rule values never leak into automatic hits such as outlinks. Requires Piwik PRO tracker 15.3 or later.',\n code: [\n {\n lang: 'json',\n code: '{ \"settings\": { \"customDimensions\": { \"1\": \"globals.pagegroup\" } }, \"mapping\": { \"product\": { \"add\": { \"name\": \"trackEvent\", \"data\": { \"set\": [\"entity\", \"action\", \"data.name\"] }, \"settings\": { \"customDimensions\": { \"2\": \"data.size\" } } } } } }',\n },\n ],\n },\n 'portable-methods': {\n text: 'rule.name is a Piwik PRO JS API method and data resolves to its positional arguments (an array built with set is spread). The 13 portable methods (trackPageView, trackEvent, trackGoal, trackSiteSearch, trackLink, trackContentImpression, trackContentInteraction, ecommerceProductDetailView, ecommerceAddToCart, ecommerceRemoveFromCart, ecommerceCartUpdate, ecommerceOrder, ping) copy unchanged to the server destination @walkeros/server-destination-piwikpro. Any other _paq command, such as setUserId, works on web by explicit name but is web-only.',\n code: [\n {\n lang: 'json',\n code: '{ \"order\": { \"complete\": { \"name\": \"trackEvent\", \"data\": { \"set\": [\"entity\", \"action\", \"data.id\"] }, \"settings\": { \"goalId\": \"goal-uuid\", \"goalValue\": \"data.total\" } } } }',\n },\n ],\n },\n 'unmapped-events': {\n text: 'An event without a rule name that is not a page view sends only its goal when the rule has settings.goalId, and is otherwise skipped with a warning (once per event name, then at debug level). A named rule with silent: true also sends only its goal. To keep other events out of the destination entirely, ignore everything with a wildcard and keep the page view explicitly.',\n code: [\n {\n lang: 'json',\n code: '{ \"mapping\": { \"*\": { \"*\": { \"ignore\": true } }, \"page\": { \"view\": {} } } }',\n },\n ],\n },\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS,SAAS;AAE3B,IAAM,EAAE,YAAY,IAAI;AAEjB,IAAM,yBAAyB,EAAE;AAAA,EACtC,EAAE,OAAO,EAAE,MAAM,SAAS,8CAA8C;AAAA,EACxE;AACF;AAEO,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,OAAO,EACJ,OAAO,EACP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AA,EACF;AAAA,EACA,mBAAmB;AAAA,IACjB,MAAM;AAAA,IACN,MAAM;AAAA,MACJ;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;","names":["schemas","z","z","schemas","init"]}
|
|
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","../src/hints.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\n// Types of record live in ../types; the zod types loosen through core's ValueSchema\nexport { SettingsSchema } from './settings';\nexport { MappingSchema } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { schemas, z } from '@walkeros/core/dev';\n\nconst { ValueSchema } = schemas;\n\nexport const CustomDimensionsSchema = z.record(\n z.string().regex(/^\\d+$/, 'Dimension keys are bare numeric ids like \"1\"'),\n ValueSchema,\n);\n\nexport const SettingsSchema = z.object({\n appId: z\n .string()\n .min(1)\n .describe(\n 'ID of the Piwik PRO site (like XXX-XXX-XXX-XXX-XXX). Required when loadScript is true',\n )\n .optional(),\n url: z\n .string()\n .url()\n .describe(\n 'URL of your Piwik PRO account, normalized to one trailing slash (like https://your_account_name.piwik.pro/). Required when loadScript is true',\n )\n .optional(),\n linkTracking: z\n .boolean()\n .default(true)\n .describe(\n 'Automatic outlink and download tracking, enabled right after the first hit this destination sends. Default: true',\n ),\n identified: z\n .union([z.boolean(), z.record(z.string(), z.boolean())])\n .describe(\n 'Identified or anonymous tracking. true (default) identifies every hit, false switches the tracker to anonymous mode without cookies (disableCookies, deleteCookies, setUserIsAnonymous) at init. A consent object like { marketing: true } identifies only while that consent is granted and calls enableCookies and deanonymizeUser once it is. Do not repeat these states in config.consent: a destination needs only one of its config.consent states granted, so next to another state the repeated one lets events through on its own, and as the only state it queues every event until granted, so no anonymous hit is sent.',\n )\n .optional(),\n customDimensions: CustomDimensionsSchema.describe(\n 'Custom dimensions applied to every hit, keyed by bare dimension id (like { \"1\": \"data.size\" }). Rule-level customDimensions win per key.',\n ).optional(),\n});\n","import { schemas, z } from '@walkeros/core/dev';\nimport { CustomDimensionsSchema } from './settings';\n\nexport const MappingSchema = z.object({\n goalId: z\n .union([z.string(), z.number()])\n .describe(\n 'Piwik PRO goal id (UUID or legacy integer). Adds a second hit, trackGoal.',\n )\n .optional(),\n goalValue: schemas.ValueSchema.describe(\n 'Goal revenue, resolved from the event (like \"data.total\"), passed as the trackGoal conversion value',\n ).optional(),\n customDimensions: CustomDimensionsSchema.describe(\n 'Custom dimensions for this rule, keyed by bare dimension id (like { \"1\": \"data.size\" }). Wins per key over the destination customDimensions.',\n ).optional(),\n});\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for PiwikPro destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring external dependencies.\n */\n\nexport const init: Env | undefined = {\n window: {\n // _paq absent: init() is expected to install the queue.\n },\n document: {\n createElement: () => ({\n type: '',\n src: '',\n async: false,\n defer: false,\n }),\n head: { appendChild: () => {} },\n },\n};\n\nexport const push: Env = {\n window: {\n _paq: [],\n },\n document: {\n createElement: () => ({\n type: '',\n src: '',\n async: false,\n defer: false,\n }),\n head: { appendChild: () => {} },\n },\n};\n\n/**\n * Simulation tracking paths\n * Specifies which function calls to track during simulation\n */\nexport const simulation = [\n 'call:window._paq.push', // Track _paq.push calls\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\n/**\n * Destination bootstrap.\n * Given the canonical settings, init loads the PiwikPro script and configures\n * the tracker URL and app id. Link tracking follows the first hit instead\n * (see `linkTrackingAfterFirstHit`). Reproduce by passing the same settings to\n * `startFlow` as the destination config.\n */\nexport const init: Flow.StepExample = {\n title: 'Initialization',\n description:\n 'Destination bootstrap loads the Piwik PRO tracker and configures the tracker URL and app id.',\n in: {\n loadScript: true,\n settings: {\n appId: 'XXX-XXX-XXX-XXX-XXX',\n url: 'https://your_account_name.piwik.pro/',\n },\n },\n out: [\n [\n '_paq.push',\n ['setTrackerUrl', 'https://your_account_name.piwik.pro/ppms.php'],\n ],\n ['_paq.push', ['setSiteId', 'XXX-XXX-XXX-XXX-XXX']],\n ],\n};\n\n/**\n * Runs with the default settings (linkTracking on). The other event examples\n * run with `linkTracking: false`, so their `out` holds only their own commands.\n */\nexport const linkTrackingAfterFirstHit: Flow.StepExample = {\n title: 'Link tracking after the first hit',\n description:\n 'With the default linkTracking setting, the first hit is followed by enableLinkTracking for automatic outlink and download tracking.',\n in: getEvent('page view', { timestamp: 1700000312 }),\n out: [['trackPageView', 'walkerOS documentation'], ['enableLinkTracking']],\n};\n\nexport const ecommerceOrder: Flow.StepExample = {\n title: 'Ecommerce order',\n description:\n 'A completed order calls Piwik PRO ecommerceOrder with line items and order totals.',\n in: getEvent('order complete', { timestamp: 1700000300 }),\n mapping: {\n name: 'ecommerceOrder',\n data: {\n set: [\n {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n typeof entity === 'object' &&\n entity !== null &&\n 'entity' in entity &&\n entity.entity === 'product',\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n customDimensions: {\n map: {\n 1: 'data.size',\n },\n },\n },\n },\n ],\n },\n {\n map: {\n orderId: 'data.id',\n grandTotal: 'data.total',\n tax: 'data.taxes',\n shipping: 'data.shipping',\n },\n },\n ],\n },\n },\n out: [\n [\n 'ecommerceOrder',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n customDimensions: { 1: 'l' },\n },\n {\n sku: 'cc',\n name: 'Cool Cap',\n price: 42,\n quantity: 1,\n customDimensions: { 1: 'one size' },\n },\n ],\n {\n orderId: '0rd3r1d',\n grandTotal: 555,\n tax: 73.76,\n shipping: 5.22,\n },\n ],\n ],\n};\n\nexport const ecommerceAddToCart: Flow.StepExample = {\n title: 'Add to cart',\n description:\n 'A product add fires Piwik PRO ecommerceAddToCart with the added item.',\n in: getEvent('product add', { timestamp: 1700000301 }),\n mapping: {\n name: 'ecommerceAddToCart',\n data: {\n set: [\n {\n set: [\n {\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n customDimensions: {\n map: {\n 1: 'data.size',\n },\n },\n },\n },\n ],\n },\n ],\n },\n },\n out: [\n [\n 'ecommerceAddToCart',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n customDimensions: { 1: 'l' },\n },\n ],\n ],\n ],\n};\n\nexport const productDetailView: Flow.StepExample = {\n title: 'Product detail view',\n description:\n 'A product view fires Piwik PRO ecommerceProductDetailView with a single-item array.',\n in: getEvent('product view', { timestamp: 1700000302 }),\n mapping: {\n name: 'ecommerceProductDetailView',\n data: {\n set: [\n {\n set: [\n {\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n customDimensions: {\n map: {\n 1: 'data.size',\n },\n },\n },\n },\n ],\n },\n ],\n },\n },\n out: [\n [\n 'ecommerceProductDetailView',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n customDimensions: { 1: 'l' },\n },\n ],\n ],\n ],\n};\n\nexport const cartUpdate: Flow.StepExample = {\n title: 'Cart update',\n description:\n 'A cart view fires Piwik PRO ecommerceCartUpdate with nested products and the cart total.',\n in: getEvent('cart view', { timestamp: 1700000303 }),\n mapping: {\n name: 'ecommerceCartUpdate',\n data: {\n set: [\n {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n typeof entity === 'object' &&\n entity !== null &&\n 'entity' in entity &&\n entity.entity === 'product',\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n customDimensions: {\n map: {\n 1: 'data.size',\n },\n },\n },\n },\n ],\n },\n 'data.value',\n ],\n },\n },\n out: [\n [\n 'ecommerceCartUpdate',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n customDimensions: { 1: 'l' },\n },\n ],\n 840,\n ],\n ],\n};\n\nexport const customEvent: Flow.StepExample = {\n title: 'Custom event with goal',\n description:\n 'A promotion visible event fires Piwik PRO trackEvent and then trackGoal to record a goal conversion.',\n in: getEvent('promotion visible', { timestamp: 1700000304 }),\n mapping: {\n name: 'trackEvent',\n settings: {\n goalId: 'goal_1',\n },\n data: {\n set: ['data.name', 'data.position'],\n },\n },\n out: [\n ['trackEvent', 'Setting up tracking easily', 'hero'],\n ['trackGoal', 'goal_1'],\n ],\n};\n\nexport const pageViewWithTitle: Flow.StepExample = {\n title: 'Page view',\n description:\n 'A page view fires Piwik PRO trackPageView with the page title resolved from event data.',\n in: getEvent('page view', { timestamp: 1700000305 }),\n mapping: {\n data: 'data.title',\n },\n out: [['trackPageView', 'walkerOS documentation']],\n};\n\nexport const pageViewWithGoal: Flow.StepExample = {\n title: 'Page view with goal',\n description:\n 'A page view rule with a goal keeps the default trackPageView and adds a trackGoal conversion.',\n in: getEvent('page view', { timestamp: 1700000306 }),\n mapping: {\n settings: {\n goalId: 'goal_1',\n },\n },\n out: [\n ['trackPageView', 'walkerOS documentation'],\n ['trackGoal', 'goal_1'],\n ],\n};\n\nexport const eventWithGoalValue: Flow.StepExample = {\n title: 'Event with goal value',\n description:\n 'An order complete fires Piwik PRO trackEvent and then trackGoal with the order total as the conversion value.',\n in: getEvent('order complete', { timestamp: 1700000307 }),\n mapping: {\n name: 'trackEvent',\n data: {\n set: [{ value: 'order' }, { value: 'complete' }, 'data.id'],\n },\n settings: {\n goalId: 'goal_1',\n goalValue: 'data.total',\n },\n },\n out: [\n ['trackEvent', 'order', 'complete', '0rd3r1d'],\n ['trackGoal', 'goal_1', 555],\n ],\n};\n\nexport const ecommerceRemoveFromCart: Flow.StepExample = {\n title: 'Remove from cart',\n description:\n 'A product remove fires Piwik PRO ecommerceRemoveFromCart with the removed item.',\n in: getEvent('product remove', {\n timestamp: 1700000308,\n data: {\n id: 'ers',\n name: 'Everyday Ruck Snack',\n color: 'black',\n size: 'l',\n price: 420,\n },\n }),\n mapping: {\n name: 'ecommerceRemoveFromCart',\n data: {\n set: [\n {\n set: [\n {\n map: {\n sku: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { value: 1 },\n variant: { key: 'data.color' },\n },\n },\n ],\n },\n ],\n },\n },\n out: [\n [\n 'ecommerceRemoveFromCart',\n [\n {\n sku: 'ers',\n name: 'Everyday Ruck Snack',\n price: 420,\n quantity: 1,\n variant: 'black',\n },\n ],\n ],\n ],\n};\n\nexport const siteSearch: Flow.StepExample = {\n title: 'Site search',\n description:\n 'A search submit fires Piwik PRO trackSiteSearch with the keyword, category, and result count.',\n in: getEvent('search submit', {\n timestamp: 1700000309,\n data: { query: 'rucksack', category: 'bags', results: 12 },\n }),\n mapping: {\n name: 'trackSiteSearch',\n data: {\n set: ['data.query', 'data.category', 'data.results'],\n },\n },\n out: [['trackSiteSearch', 'rucksack', 'bags', 12]],\n};\n\nexport const linkDownload: Flow.StepExample = {\n title: 'Download link',\n description:\n 'A file download fires Piwik PRO trackLink with the file URL and the download link type.',\n in: getEvent('file download', {\n timestamp: 1700000310,\n data: { url: 'https://www.example.com/whitepaper.pdf' },\n }),\n mapping: {\n name: 'trackLink',\n data: {\n set: ['data.url', { value: 'download' }],\n },\n },\n out: [['trackLink', 'https://www.example.com/whitepaper.pdf', 'download']],\n};\n\nexport const ping: Flow.StepExample = {\n title: 'Ping',\n description:\n 'A pulse-triggered event fires Piwik PRO ping to extend the time spent on the page.',\n in: getEvent('page ping', { timestamp: 1700000311, trigger: 'pulse' }),\n mapping: {\n name: 'ping',\n },\n out: [['ping']],\n};\n\nexport const customDimensionsEvent: Flow.StepExample = {\n title: 'Event with custom dimensions',\n description:\n 'A product add fires Piwik PRO trackEvent with rule-level custom dimensions as its dimensions argument, values percent-encoded.',\n in: getEvent('product add', { timestamp: 1700000313 }),\n mapping: {\n name: 'trackEvent',\n data: {\n set: ['entity', 'action', 'data.name', 'data.price'],\n },\n settings: {\n customDimensions: {\n 1: 'data.size',\n 2: 'data.name',\n },\n },\n },\n out: [\n [\n 'trackEvent',\n 'product',\n 'add',\n 'Everyday Ruck Snack',\n 420,\n { dimension1: 'l', dimension2: 'Everyday%20Ruck%20Snack' },\n ],\n ],\n};\n\nexport const customDimensionsPageView: Flow.StepExample = {\n title: 'Page view with custom dimensions',\n description:\n 'trackPageView has no dimensions argument, so rule-level custom dimensions are set right before the hit and deleted right after it.',\n in: getEvent('page view', { timestamp: 1700000314 }),\n mapping: {\n settings: {\n customDimensions: {\n 1: 'globals.pagegroup',\n },\n },\n },\n out: [\n ['setCustomDimensionValue', 1, 'docs'],\n ['trackPageView', 'walkerOS documentation'],\n ['deleteCustomDimension', 1],\n ],\n};\n","import type { Hint } from '@walkeros/core';\n\nexport const hints: Hint.Hints = {\n 'identified-consent': {\n text: 'settings.identified controls identified or anonymous tracking. Absent or true: identified, the Piwik PRO default. false: anonymous from init, without tracker cookies (disableCookies, deleteCookies, setUserIsAnonymous(true)). A consent object like { \"marketing\": true }: anonymous and cookieless until that consent is granted, then enableCookies and deanonymizeUser merge the anonymous session into the identified visitor. Keep config.consent for the states that gate tracking at all and do not repeat the identified states there: a destination needs only one of its config.consent states granted, so next to another state the repeated one lets events through on its own, and as the only state it queues every event until granted, so no anonymous hit is sent.',\n code: [\n {\n lang: 'json',\n code: '{ \"consent\": { \"analytics\": true }, \"settings\": { \"identified\": { \"marketing\": true } } }',\n },\n ],\n },\n 'custom-dimensions': {\n text: 'customDimensions maps bare dimension ids to Mapping Values, at destination level (every hit) and at rule level (wins per key); a dimensions object the mapping passes as the method argument wins over both. trackEvent, trackGoal, trackSiteSearch and trackLink get { \"dimension<id>\": value } as their dimensions argument, values percent-encoded. Every other portable method (trackPageView, the content and ecommerce methods, ping) is wrapped: setCustomDimensionValue before the hit, then rule-only dimensions are deleted and destination values set again, so rule values never leak into automatic hits such as outlinks. Requires Piwik PRO tracker 15.3 or later.',\n code: [\n {\n lang: 'json',\n code: '{ \"settings\": { \"customDimensions\": { \"1\": \"globals.pagegroup\" } }, \"mapping\": { \"product\": { \"add\": { \"name\": \"trackEvent\", \"data\": { \"set\": [\"entity\", \"action\", \"data.name\"] }, \"settings\": { \"customDimensions\": { \"2\": \"data.size\" } } } } } }',\n },\n ],\n },\n 'portable-methods': {\n text: 'rule.name is a Piwik PRO JS API method and data resolves to its positional arguments (an array built with set is spread). The 13 portable methods (trackPageView, trackEvent, trackGoal, trackSiteSearch, trackLink, trackContentImpression, trackContentInteraction, ecommerceProductDetailView, ecommerceAddToCart, ecommerceRemoveFromCart, ecommerceCartUpdate, ecommerceOrder, ping) copy unchanged to the server destination @walkeros/server-destination-piwikpro. Any other _paq command, such as setUserId, works on web by explicit name but is web-only.',\n code: [\n {\n lang: 'json',\n code: '{ \"order\": { \"complete\": { \"name\": \"trackEvent\", \"data\": { \"set\": [\"entity\", \"action\", \"data.id\"] }, \"settings\": { \"goalId\": \"goal-uuid\", \"goalValue\": \"data.total\" } } } }',\n },\n ],\n },\n 'unmapped-events': {\n text: 'An event without a rule name that is not a page view sends only its goal when the rule has settings.goalId, and is otherwise skipped with a warning (once per event name, then at debug level). A named rule with silent: true also sends only its goal. To keep other events out of the destination entirely, ignore everything with a wildcard and keep the page view explicitly.',\n code: [\n {\n lang: 'json',\n code: '{ \"mapping\": { \"*\": { \"*\": { \"ignore\": true } }, \"page\": { \"view\": {} } } }',\n },\n ],\n },\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,S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AAqB;AAAA,IACnB,MAAM;AAAA,IACN,MAAM;AAAA,MACJ;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAAA,EACA,oBAAoB;AAAA,IAClB,MAAM;AAAA,IACN,MAAM;AAAA,MACJ;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAAA,EACA,mBAAmB;AAAA,IACjB,MAAM;AAAA,IACN,MAAM;AAAA,MACJ;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;","names":["schemas","z","z","schemas","init"]}
|
package/dist/examples/index.js
CHANGED
|
@@ -124,7 +124,7 @@ var ecommerceOrder = {
|
|
|
124
124
|
loop: [
|
|
125
125
|
"nested",
|
|
126
126
|
{
|
|
127
|
-
condition: (entity) =>
|
|
127
|
+
condition: (entity) => typeof entity === "object" && entity !== null && "entity" in entity && entity.entity === "product",
|
|
128
128
|
map: {
|
|
129
129
|
sku: "data.id",
|
|
130
130
|
name: "data.name",
|
|
@@ -282,7 +282,7 @@ var cartUpdate = {
|
|
|
282
282
|
loop: [
|
|
283
283
|
"nested",
|
|
284
284
|
{
|
|
285
|
-
condition: (entity) =>
|
|
285
|
+
condition: (entity) => typeof entity === "object" && entity !== null && "entity" in entity && entity.entity === "product",
|
|
286
286
|
map: {
|
|
287
287
|
sku: "data.id",
|
|
288
288
|
name: "data.name",
|
package/dist/examples/index.mjs
CHANGED
|
@@ -66,7 +66,7 @@ __export(step_exports, {
|
|
|
66
66
|
productDetailView: () => productDetailView,
|
|
67
67
|
siteSearch: () => siteSearch
|
|
68
68
|
});
|
|
69
|
-
import { getEvent
|
|
69
|
+
import { getEvent } from "@walkeros/core";
|
|
70
70
|
var init2 = {
|
|
71
71
|
title: "Initialization",
|
|
72
72
|
description: "Destination bootstrap loads the Piwik PRO tracker and configures the tracker URL and app id.",
|
|
@@ -103,7 +103,7 @@ var ecommerceOrder = {
|
|
|
103
103
|
loop: [
|
|
104
104
|
"nested",
|
|
105
105
|
{
|
|
106
|
-
condition: (entity) =>
|
|
106
|
+
condition: (entity) => typeof entity === "object" && entity !== null && "entity" in entity && entity.entity === "product",
|
|
107
107
|
map: {
|
|
108
108
|
sku: "data.id",
|
|
109
109
|
name: "data.name",
|
|
@@ -261,7 +261,7 @@ var cartUpdate = {
|
|
|
261
261
|
loop: [
|
|
262
262
|
"nested",
|
|
263
263
|
{
|
|
264
|
-
condition: (entity) =>
|
|
264
|
+
condition: (entity) => typeof entity === "object" && entity !== null && "entity" in entity && entity.entity === "product",
|
|
265
265
|
map: {
|
|
266
266
|
sku: "data.id",
|
|
267
267
|
name: "data.name",
|
package/dist/index.browser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Destination=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,o={};((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(o,{DestinationPiwikPro:()=>X,default:()=>re,destinationPiwikPro:()=>Z});var i=Object.defineProperty,c=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})};function s(e,t){if("collector"===e)return"collector";if(!t)throw new Error(`stepId(${e}) requires an id`);return`${e}.${t}`}c({},{stepId:()=>s});function a(e,t){const n=e.destinations[t];if(!n)throw new Error(`Destination not found: ${t}`);return n}c({},{getDestination:()=>a});c({},{Level:()=>f});var u,f=((u=f||{})[u.ERROR=0]="ERROR",u[u.WARN=1]="WARN",u[u.INFO=2]="INFO",u[u.DEBUG=3]="DEBUG",u);function l(e,t){const n=e.transformers[t];if(!n)throw new Error(`Transformer not found: ${t}`);return n}c({},{getTransformer:()=>l});function d(e,t){const n=e.sources[t];if(!n)throw new Error(`Source not found: ${t}`);return n}c({},{getSource:()=>d});function p(e,t){const n=e.stores[t];if(!n)throw new Error(`Store not found: ${t}`);return n}async function g(e,t){return await e.get(t)}function v(e){return Array.isArray(e)}function y(e){return void 0!==e}function m(e){return"object"==typeof e&&null!==e&&"then"in e&&"function"==typeof e.then}function w(e){return"object"==typeof e&&null!==e&&!v(e)&&"[object Object]"===Object.prototype.toString.call(e)}function h(e){return"string"==typeof e}function b(e,t="",n){const r=t.split(".");let o=e;for(let e=0;e<r.length;e++){const t=r[e];if("*"===t&&v(o)){const t=r.slice(e+1).join("."),i=[];for(const e of o){const r=b(e,t,n);i.push(r)}return i}if(o=w(o)||v(o)?o[t]:void 0,void 0===o)break}return y(o)?o:n}function O(e,t={},n={}){const r={...t,...n},o={};let i=!e||0===Object.keys(e).length;return Object.keys(r).forEach(t=>{r[t]&&(o[t]=!0,e&&e[t]&&(i=!0))}),!!i&&o}function k(e){return function(e){return"boolean"==typeof e}(e)||h(e)||function(e){return"number"==typeof e&&!Number.isNaN(e)}(e)||!y(e)||v(e)&&e.every(k)||w(e)&&Object.values(e).every(k)}function j(e){return k(e)?e:void 0}function P(e,t,n){return async function(...r){try{return await e(...r)}catch(e){if(!t)return;return await t(e)}finally{await(null==n?void 0:n())}}}c({},{getStore:()=>p,getStoreValue:()=>g});var R=class e extends Error{constructor(t,n){super(t,n),this.name="FatalError",Object.setPrototypeOf(this,e.prototype)}};async function E(e,t={},n={}){var r,o;const i=n.consent||(null==(r=n.collector)?void 0:r.consent),c=null!=(o=n.event)?o:{};if(!n.collector)throw new Error("getMappingValue: context.collector is required");const s={event:c,mapping:t,collector:n.collector,logger:n.collector.logger,consent:i},a=v(t)?t:[t];for(const t of a){const r=await P(S,e=>{if(e instanceof R)throw e;n.collector&&n.collector.status.failed++,s.logger.error("mapping processing failed",{event:c,error:e})})(e,t,{...s,mapping:t});if(y(r))return r}}async function S(e,t,n){return(v(t)?t:[t]).reduce(async(t,r)=>{const o=await t;if(o)return o;const i=h(r)?{key:r}:r;if(!Object.keys(i).length)return;const{condition:c,consent:s,fn:a,key:u,loop:f,map:l,set:d,validate:p,value:g}=i,m={...n,mapping:r};if(c&&!await P(c,e=>{if(e instanceof R)throw e;return m.logger.error("mapping condition failed",{event:m.event,error:e}),!1})(e,m))return;if(s&&!O(s,m.consent))return g;let w=y(g)?g:e;if(f){const[t,n]=f,r="this"===t?[e]:await E(e,t,m);w=v(r)?(await Promise.all(r.map(e=>y(e)?E(e,n,m):void 0))).filter(y):void 0}else l?w=await Object.entries(l).reduce(async(t,[n,r])=>{const o=await t,i=await E(e,r,m);return y(i)&&(o[n]=i),o},Promise.resolve({})):d?w=await Promise.all(d.map(t=>S(e,t,m))):u?w=b(e,u,g):a&&(w=await P(a,e=>{if(e instanceof R)throw e;m.logger.error("mapping fn failed",{event:m.event,error:e})})(e,m));p&&!await P(p,e=>{if(e instanceof R)throw e;return m.logger.error("mapping validate failed",{event:m.event,error:e}),!1})(w,m)&&(w=void 0);const k=j(w);return y(k)?k:j(g)},Promise.resolve(void 0))}async function $(e,t={},n={}){var r,o;if(!y(e))return;const i=w(e)&&e.consent||n.consent||(null==(r=n.collector)?void 0:r.consent),c=null!=(o=n.event)?o:w(e)?e:{};return E(e,t,{...n,consent:i,event:c})}var _="observe";function D(e){const t=(e.startsWith("call:")?e.slice(5):e).split(".");return t.some(e=>""===e)?[]:t}function C(e){return"function"==typeof e}function A(e){return"object"==typeof e&&null!==e}var I=["name","length","prototype","arguments","caller"];function N(e,t){if(-1!==I.indexOf(t))return!1;let n=e;for(;C(n);){if(Object.prototype.hasOwnProperty.call(n,t))return!0;const e=Object.getPrototypeOf(n);if(!C(e)||!C(Object.getPrototypeOf(e)))return!1;n=e}return!1}function x(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!(n&&!n.configurable)||"value"in n&&!0===n.writable}function V(e,t){let n=e;for(const e of t){if(C(n)){if(!N(n,e))return!0;if(!x(n,e))return!1}else if(m(n)){if(!(e in n))return!0}else if(!A(n)||!(e in n))return!1;n=Reflect.get(n,e)}return C(n)}function W(e){const t={window:"undefined"!=typeof window?window:globalThis.window,document:"undefined"!=typeof document?document:globalThis.document,...e},n=e&&e[_];if(("undefined"==typeof __WALKEROS_OBSERVE__||__WALKEROS_OBSERVE__)&&function(e){if("object"!=typeof e||null===e)return!1;if(!("paths"in e)||!("record"in e))return!1;const{paths:t,record:n}=e;return Array.isArray(t)&&t.every(e=>"string"==typeof e)&&"function"==typeof n}(n)){delete t[_];const e=function(e,t,n){const r=[],o=[],i=[];for(const n of t){const t=D(n);if(0===t.length)continue;const r=t.join(".");i.push({rest:t,fn:r}),V(e,t)||o.push(r)}const c=new WeakMap,s=new WeakSet;function a(e,t){for(const o of e)if(n)try{n(o,t)}catch(e){}else r.push({fn:o,args:t,ts:Date.now()})}function u(e,t){return 0===t.length||f(e)?e:m(e)&&!t.some(t=>t.rest[0]in e)?Promise.resolve(e).then(e=>u(e,t)):C(e)?y(e,[],t):A(e)?d(e,t):e}function f(e){return(A(e)||C(e))&&s.has(e)}function l(e,t){const n=[],r=[];for(const o of e)o.rest[0]===t&&(1===o.rest.length?n.includes(o.fn)||n.push(o.fn):r.push({rest:o.rest.slice(1),fn:o.fn}));return{leafs:n,deeper:r}}function d(e,t){var n;const r=t.map(e=>`${e.fn}:${e.rest.join(".")}`).join("|"),o=null!=(n=c.get(e))?n:new Map;c.set(e,o);const i=o.get(r);if(i)return i;const s=p(e,t);return o.set(r,s),s}function p(e,t){return C(e)?g(e,t):t.some(t=>!x(e,t.rest[0]))?function(e,t){const n=Object.create(Object.getPrototypeOf(e)),r=v(e,t,()=>o),o=new Proxy(n,{get:(e,t)=>r.get(t),set:(t,n,r)=>Reflect.set(e,n,r,e),has:(t,n)=>Reflect.has(e,n),ownKeys:()=>Reflect.ownKeys(e),getOwnPropertyDescriptor(t,n){const r=Reflect.getOwnPropertyDescriptor(e,n);return r&&{...r,configurable:!0}},defineProperty:(t,n,r)=>Reflect.defineProperty(e,n,r),deleteProperty:(t,n)=>Reflect.deleteProperty(e,n)});return s.add(o),o}(e,t):g(e,t)}function g(e,t){const n=v(e,t,()=>r),r=new Proxy(e,{get:(e,t)=>"string"!=typeof t||x(e,t)?n.get(t):Reflect.get(e,t,e),set:(e,t,n)=>Reflect.set(e,t,n,e)});return s.add(r),r}function v(e,t,n){const r=new Map;return{get(o){const i=Reflect.get(e,o,e);if("string"!=typeof o)return i;if(!C(i)&&!A(i))return i;if(f(i))return i;const c=r.get(o);if(c&&c.value===i)return c.out;const{leafs:s,deeper:a}=l(t,o);if(!(s.length>0||a.length>0)&&(!C(i)||function(e){if(Array.isArray(e))return!0;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}(e)))return i;let u=i;return C(i)?u=y(i,s,a,{proxy:n(),target:e}):a.length>0&&(u=d(i,a)),r.set(o,{value:i,out:u}),u}}}function y(e,t,n,r){const o=()=>n.filter(t=>!N(e,t.rest[0])),i=new Map,c=new Proxy(e,{get(e,t){const r=Reflect.get(e,t,e);if("string"!=typeof t||!x(e,t))return r;if(!N(e,t))return r;const{leafs:o,deeper:s}=l(n,t);if(0===o.length&&0===s.length)return r;if(f(r))return r;const a=i.get(t);if(a&&a.value===r)return a.out;let u=r;return C(r)?u=y(r,o,s,{proxy:c,target:e}):A(r)&&s.length>0&&(u=d(r,s)),i.set(t,{value:r,out:u}),u},set:(e,t,n)=>Reflect.set(e,t,n,e),apply(e,n,i){a(t,i);const c=!r||n!==r.proxy&&void 0!==n?n:r.target;return u(Reflect.apply(e,c,i),o())},construct(e,n,r){a(t,n);const i=Reflect.construct(e,n,r===c?e:r),s=u(i,o());return A(s)||C(s)?s:i}});return s.add(c),c}return{env:p(e,i),calls:r,unresolved:o}}(t,n.paths,n.record).env,r=new Set;for(const e of n.paths){const n=D(e)[0];if(void 0===n)continue;const o=t[n];null!==o&&"object"==typeof o&&r.add(n)}const o=Array.from(r,t=>[t,e[t]]);for(const[e,n]of o)t[e]=n}return t}var q=/^dimension\d+$/,T=/^\d+$/;async function M(e,t,n){const r={};if(!e)return r;for(const[o,i]of Object.entries(e)){const e=await $(t,i,{collector:n});r[o]=null==e?void 0:String(e)}return r}function U(e){return G(e).map(([e,t])=>void 0===t?["deleteCustomDimension",Number(e)]:["setCustomDimensionValue",Number(e),t])}function G(e){return Object.entries(e).filter(([e])=>T.test(e)).sort(([e],[t])=>Number(e)-Number(t))}function L(e){try{return encodeURIComponent(e)}catch(e){return}}function B(e,t,n){return void 0===e||!0===e||!1!==e&&!1!==O(e,t.consent,null==n?void 0:n.consent)}var F=new WeakMap;function K(e,t){var n;const r=null==(n=F.get(e))||n;return F.set(e,t),r===t?[]:t?[["enableCookies"],["deanonymizeUser"]]:[["disableCookies"],["deleteCookies"],["setUserIsAnonymous",!0]]}var z=["trackPageView","trackEvent","trackGoal","trackSiteSearch","trackLink","trackContentImpression","trackContentInteraction","ecommerceProductDetailView","ecommerceAddToCart","ecommerceRemoveFromCart","ecommerceCartUpdate","ecommerceOrder","ping"];var H={trackEvent:4,trackGoal:2,trackSiteSearch:3,trackLink:2},J=new Set;function Q(e,t,n,r){if(!J.has(t)&&J.size<1e3)return J.add(t),void e.warn(n,r);e.debug(n,r)}var X={},Y=new WeakSet,Z={type:"piwikpro",config:{},init({config:e,env:t,logger:n,collector:r}){const{window:o}=W(t),{settings:i={},loadScript:c}=e,{appId:s,url:a}=i;o._paq=o._paq||[];const u=o._paq,f=e=>{u.push(e)};if(c){if(!s)return n.throw("Config settings appId missing");if(!a)return n.throw("Config settings url missing");const e=function(e){return`${e.replace(/\/+$/,"")}/`}(a);!function(e,t){const{document:n}=W(t),r=n.createElement("script");r.type="text/javascript",r.src=e+"ppms.js",r.async=!0,r.defer=!0,n.head.appendChild(r)}(e,t),f(["setTrackerUrl",e+"ppms.php"]),f(["setSiteId",s])}B(i.identified,r)||K(r,!1).forEach(f)},async push(e,{config:t,rule:n={},data:r,env:o,collector:i,logger:c,id:s}){const{window:a}=W(o),u=a._paq;if(!u)return void c.warn("Piwik PRO _paq queue missing, init() not run");const f=e=>{u.push(e)},l=t.settings||{},d=!1!==l.linkTracking,p=e=>{f(e),d&&!Y.has(i)&&(Y.add(i),f(["enableLinkTracking"]))},g=n.settings||{},{goalId:y}=g,m=!n.name&&"page view"===e.name,w=n.name?e.name:m?"trackPageView":void 0;if(void 0===w&&void 0===y)return void Q(c,`${s}|${e.name}|unmapped`,`Event "${e.name}" skipped: no rule name, no goal and not a page view`,{event:e.name,reason:"unmapped"});const h=!0===n.silent?void 0:w,b=void 0!==h&&(O=h,z.some(e=>e===O))?h:void 0;var O;if(void 0===h&&void 0===y)return void Q(c,`${s}|${e.name}|silent`,`Event "${e.name}" skipped: silent rule without a goal`,{event:e.name,reason:"silent"});const k=void 0===h?[]:m&&void 0===n.data?[await $(e,"data.title",{collector:i})]:function(e){return void 0===e?[]:v(e)?[...e]:[e]}(r),j=void 0!==y||void 0!==b,P=j?await M(l.customDimensions,e,i):{},R=j?await M(g.customDimensions,e,i):{},E=void 0===y||void 0===g.goalValue?void 0:await $(e,g.goalValue,{collector:i});if(K(i,B(l.identified,i,e)).forEach(f),void 0!==h)if(void 0===b)f([h,...te(k)]);else if(void 0===H[b]){const{before:e,after:t}=function(e,t){const n=U({...e,...t});if(0===Object.keys(t).length)return{before:n,after:[]};const r={};for(const[n,o]of Object.entries(t))Object.prototype.hasOwnProperty.call(e,n)||void 0===o||(r[n]=void 0);return{before:n,after:[...U(r),...U(e)]}}(P,R);e.forEach(f),p([b,...te(k)]),t.forEach(f)}else p([b,...te(ee(b,k,P,R))]);void 0!==y&&p(["trackGoal",...te(ee("trackGoal",[y,E],P,R))])}};function ee(e,t,n,r){const o=H[e];if(void 0===o)return t;const i=function(e,t,n){const r={};for(const[n,o]of G({...e,...t})){const e=void 0===o?void 0:L(o);void 0!==e&&(r[`dimension${n}`]=e)}if(w(n))for(const[e,t]of Object.entries(n))q.test(e)&&null!=t&&(r[e]=String(t));return r}(n,r,t[o]),c=0===Object.keys(i).length;if(c&&o>=t.length)return t;const s=[...t];for(;s.length<o;)s.push(void 0);return s[o]=c?void 0:i,s}function te(e){let t=e.length;for(;t>0&&void 0===e[t-1];)t--;return e.slice(0,t)}var ne,re=Z;return ne=o,((o,i,c,s)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let a of n(i))r.call(o,a)||a===c||e(o,a,{get:()=>i[a],enumerable:!(s=t(i,a))||s.enumerable});return o})(e({},"__esModule",{value:!0}),ne)})();
|
|
1
|
+
"use strict";var Destination=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,o={};((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(o,{DestinationPiwikPro:()=>X,default:()=>re,destinationPiwikPro:()=>Z});var i=Object.defineProperty,c=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})};function s(e,t){if("collector"===e)return"collector";if(!t)throw new Error(`stepId(${e}) requires an id`);return`${e}.${t}`}c({},{stepId:()=>s});function a(e,t){const n=e.destinations[t];if(!n)throw new Error(`Destination not found: ${t}`);return n}c({},{getDestination:()=>a});c({},{Level:()=>f});var u,f=((u=f||{})[u.ERROR=0]="ERROR",u[u.WARN=1]="WARN",u[u.INFO=2]="INFO",u[u.DEBUG=3]="DEBUG",u);function l(e,t){const n=e.transformers[t];if(!n)throw new Error(`Transformer not found: ${t}`);return n}c({},{getTransformer:()=>l});function d(e,t){const n=e.sources[t];if(!n)throw new Error(`Source not found: ${t}`);return n}c({},{getSource:()=>d});function p(e,t){const n=e.stores[t];if(!n)throw new Error(`Store not found: ${t}`);return n}async function g(e,t){return await e.get(t)}function v(e){return Array.isArray(e)}function y(e){return void 0!==e}function m(e){return"object"==typeof e&&null!==e&&"then"in e&&"function"==typeof e.then}function w(e){return"object"==typeof e&&null!==e&&!v(e)&&"[object Object]"===Object.prototype.toString.call(e)}function h(e){return"string"==typeof e}function b(e,t="",n){const r=t.split(".");let o=e;for(let e=0;e<r.length;e++){const t=r[e];if("*"===t&&v(o)){const t=r.slice(e+1).join("."),i=[];for(const e of o){const r=b(e,t,n);i.push(r)}return i}if(o=w(o)||v(o)?o[t]:void 0,void 0===o)break}return y(o)?o:n}function O(e,t={},n={}){const r={...t,...n},o={};let i=!e||0===Object.keys(e).length;return Object.keys(r).forEach(t=>{r[t]&&(o[t]=!0,e&&e[t]&&(i=!0))}),!!i&&o}function k(e){return function(e){return"boolean"==typeof e}(e)||h(e)||function(e){return"number"==typeof e&&!Number.isNaN(e)}(e)||!y(e)||v(e)&&e.every(k)||w(e)&&Object.values(e).every(k)}function j(e){return k(e)?e:void 0}function P(e,t,n){return async function(...r){try{return await e(...r)}catch(e){if(!t)return;return await t(e)}finally{await(null==n?void 0:n())}}}c({},{getStore:()=>p,getStoreValue:()=>g});var R=class e extends Error{constructor(t,n){super(t,n),this.name="FatalError",Object.setPrototypeOf(this,e.prototype)}};async function E(e,t={},n){var r;if(!n.collector)throw new Error("getMappingValue: context.collector is required");const o=n.consent||n.collector.consent,i=null!=(r=n.event)?r:{},c={event:i,mapping:t,collector:n.collector,logger:n.collector.logger,consent:o},s=v(t)?t:[t];for(const t of s){const r=await P(S,e=>{if(e instanceof R)throw e;n.collector.status.failed++,c.logger.error("mapping processing failed",{event:i,error:e})})(e,t,{...c,mapping:t});if(y(r))return r}}async function S(e,t,n){return(v(t)?t:[t]).reduce(async(t,r)=>{const o=await t;if(o)return o;const i=h(r)?{key:r}:r;if(!Object.keys(i).length)return;const{condition:c,consent:s,fn:a,key:u,loop:f,map:l,set:d,validate:p,value:g}=i,m={...n,mapping:r};if(c&&!await P(c,e=>{if(e instanceof R)throw e;return m.logger.error("mapping condition failed",{event:m.event,error:e}),!1})(e,m))return;if(s&&!O(s,m.consent))return g;let w=y(g)?g:e;if(f){const[t,n]=f,r="this"===t?[e]:await E(e,t,m);w=v(r)?(await Promise.all(r.map(e=>y(e)?E(e,n,m):void 0))).filter(y):void 0}else l?w=await Object.entries(l).reduce(async(t,[n,r])=>{const o=await t,i=await E(e,r,m);return y(i)&&(o[n]=i),o},Promise.resolve({})):d?w=await Promise.all(d.map(t=>S(e,t,m))):u?w=b(e,u,g):a&&(w=await P(a,e=>{if(e instanceof R)throw e;m.logger.error("mapping fn failed",{event:m.event,error:e})})(e,m));p&&!await P(p,e=>{if(e instanceof R)throw e;return m.logger.error("mapping validate failed",{event:m.event,error:e}),!1})(w,m)&&(w=void 0);const k=j(w);return y(k)?k:j(g)},Promise.resolve(void 0))}async function $(e,t={},n){var r,o;if(!y(e))return;const i=w(e)&&e.consent||(null==n?void 0:n.consent)||(null==(r=null==n?void 0:n.collector)?void 0:r.consent),c=null!=(o=null==n?void 0:n.event)?o:w(e)?e:{};return E(e,t,{...n,consent:i,event:c})}var _="observe";function D(e){const t=(e.startsWith("call:")?e.slice(5):e).split(".");return t.some(e=>""===e)?[]:t}function C(e){return"function"==typeof e}function A(e){return"object"==typeof e&&null!==e}var I=["name","length","prototype","arguments","caller"];function N(e,t){if(-1!==I.indexOf(t))return!1;let n=e;for(;C(n);){if(Object.prototype.hasOwnProperty.call(n,t))return!0;const e=Object.getPrototypeOf(n);if(!C(e)||!C(Object.getPrototypeOf(e)))return!1;n=e}return!1}function x(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!(n&&!n.configurable)||"value"in n&&!0===n.writable}function V(e,t){let n=e;for(const e of t){if(C(n)){if(!N(n,e))return!0;if(!x(n,e))return!1}else if(m(n)){if(!(e in n))return!0}else if(!A(n)||!(e in n))return!1;n=Reflect.get(n,e)}return C(n)}function W(e){const t={window:"undefined"!=typeof window?window:globalThis.window,document:"undefined"!=typeof document?document:globalThis.document,...e},n=e&&e[_];if(("undefined"==typeof __WALKEROS_OBSERVE__||__WALKEROS_OBSERVE__)&&function(e){if("object"!=typeof e||null===e)return!1;if(!("paths"in e)||!("record"in e))return!1;const{paths:t,record:n}=e;return Array.isArray(t)&&t.every(e=>"string"==typeof e)&&"function"==typeof n}(n)){delete t[_];const e=function(e,t,n){const r=[],o=[],i=[];for(const n of t){const t=D(n);if(0===t.length)continue;const r=t.join(".");i.push({rest:t,fn:r}),V(e,t)||o.push(r)}const c=new WeakMap,s=new WeakSet;function a(e,t){for(const o of e)if(n)try{n(o,t)}catch(e){}else r.push({fn:o,args:t,ts:Date.now()})}function u(e,t){return 0===t.length||f(e)?e:m(e)&&!t.some(t=>t.rest[0]in e)?Promise.resolve(e).then(e=>u(e,t)):C(e)?y(e,[],t):A(e)?d(e,t):e}function f(e){return(A(e)||C(e))&&s.has(e)}function l(e,t){const n=[],r=[];for(const o of e)o.rest[0]===t&&(1===o.rest.length?n.includes(o.fn)||n.push(o.fn):r.push({rest:o.rest.slice(1),fn:o.fn}));return{leafs:n,deeper:r}}function d(e,t){var n;const r=t.map(e=>`${e.fn}:${e.rest.join(".")}`).join("|"),o=null!=(n=c.get(e))?n:new Map;c.set(e,o);const i=o.get(r);if(i)return i;const s=p(e,t);return o.set(r,s),s}function p(e,t){return C(e)?g(e,t):t.some(t=>!x(e,t.rest[0]))?function(e,t){const n=Object.create(Object.getPrototypeOf(e)),r=v(e,t,()=>o),o=new Proxy(n,{get:(e,t)=>r.get(t),set:(t,n,r)=>Reflect.set(e,n,r,e),has:(t,n)=>Reflect.has(e,n),ownKeys:()=>Reflect.ownKeys(e),getOwnPropertyDescriptor(t,n){const r=Reflect.getOwnPropertyDescriptor(e,n);return r&&{...r,configurable:!0}},defineProperty:(t,n,r)=>Reflect.defineProperty(e,n,r),deleteProperty:(t,n)=>Reflect.deleteProperty(e,n)});return s.add(o),o}(e,t):g(e,t)}function g(e,t){const n=v(e,t,()=>r),r=new Proxy(e,{get:(e,t)=>"string"!=typeof t||x(e,t)?n.get(t):Reflect.get(e,t,e),set:(e,t,n)=>Reflect.set(e,t,n,e)});return s.add(r),r}function v(e,t,n){const r=new Map;return{get(o){const i=Reflect.get(e,o,e);if("string"!=typeof o)return i;if(!C(i)&&!A(i))return i;if(f(i))return i;const c=r.get(o);if(c&&c.value===i)return c.out;const{leafs:s,deeper:a}=l(t,o);if(!(s.length>0||a.length>0)&&(!C(i)||function(e){if(Array.isArray(e))return!0;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}(e)))return i;let u=i;return C(i)?u=y(i,s,a,{proxy:n(),target:e}):a.length>0&&(u=d(i,a)),r.set(o,{value:i,out:u}),u}}}function y(e,t,n,r){const o=()=>n.filter(t=>!N(e,t.rest[0])),i=new Map,c=new Proxy(e,{get(e,t){const r=Reflect.get(e,t,e);if("string"!=typeof t||!x(e,t))return r;if(!N(e,t))return r;const{leafs:o,deeper:s}=l(n,t);if(0===o.length&&0===s.length)return r;if(f(r))return r;const a=i.get(t);if(a&&a.value===r)return a.out;let u=r;return C(r)?u=y(r,o,s,{proxy:c,target:e}):A(r)&&s.length>0&&(u=d(r,s)),i.set(t,{value:r,out:u}),u},set:(e,t,n)=>Reflect.set(e,t,n,e),apply(e,n,i){a(t,i);const c=!r||n!==r.proxy&&void 0!==n?n:r.target;return u(Reflect.apply(e,c,i),o())},construct(e,n,r){a(t,n);const i=Reflect.construct(e,n,r===c?e:r),s=u(i,o());return A(s)||C(s)?s:i}});return s.add(c),c}return{env:p(e,i),calls:r,unresolved:o}}(t,n.paths,n.record).env,r=new Set;for(const e of n.paths){const n=D(e)[0];if(void 0===n)continue;const o=t[n];null!==o&&"object"==typeof o&&r.add(n)}const o=Array.from(r,t=>[t,e[t]]);for(const[e,n]of o)t[e]=n}return t}var q=/^dimension\d+$/,T=/^\d+$/;async function M(e,t,n){const r={};if(!e)return r;for(const[o,i]of Object.entries(e)){const e=await $(t,i,{collector:n});r[o]=null==e?void 0:String(e)}return r}function U(e){return G(e).map(([e,t])=>void 0===t?["deleteCustomDimension",Number(e)]:["setCustomDimensionValue",Number(e),t])}function G(e){return Object.entries(e).filter(([e])=>T.test(e)).sort(([e],[t])=>Number(e)-Number(t))}function L(e){try{return encodeURIComponent(e)}catch(e){return}}function B(e,t,n){return void 0===e||!0===e||!1!==e&&!1!==O(e,t.consent,null==n?void 0:n.consent)}var F=new WeakMap;function K(e,t){var n;const r=null==(n=F.get(e))||n;return F.set(e,t),r===t?[]:t?[["enableCookies"],["deanonymizeUser"]]:[["disableCookies"],["deleteCookies"],["setUserIsAnonymous",!0]]}var z=["trackPageView","trackEvent","trackGoal","trackSiteSearch","trackLink","trackContentImpression","trackContentInteraction","ecommerceProductDetailView","ecommerceAddToCart","ecommerceRemoveFromCart","ecommerceCartUpdate","ecommerceOrder","ping"];var H={trackEvent:4,trackGoal:2,trackSiteSearch:3,trackLink:2},J=new Set;function Q(e,t,n,r){if(!J.has(t)&&J.size<1e3)return J.add(t),void e.warn(n,r);e.debug(n,r)}var X={},Y=new WeakSet,Z={type:"piwikpro",config:{},init({config:e,env:t,logger:n,collector:r}){const{window:o}=W(t),{settings:i={},loadScript:c}=e,{appId:s,url:a}=i;o._paq=o._paq||[];const u=o._paq,f=e=>{u.push(e)};if(c){if(!s)return n.throw("Config settings appId missing");if(!a)return n.throw("Config settings url missing");const e=function(e){return`${e.replace(/\/+$/,"")}/`}(a);!function(e,t){const{document:n}=W(t),r=n.createElement("script");r.type="text/javascript",r.src=e+"ppms.js",r.async=!0,r.defer=!0,n.head.appendChild(r)}(e,t),f(["setTrackerUrl",e+"ppms.php"]),f(["setSiteId",s])}B(i.identified,r)||K(r,!1).forEach(f)},async push(e,{config:t,rule:n={},data:r,env:o,collector:i,logger:c,id:s}){const{window:a}=W(o),u=a._paq;if(!u)return void c.warn("Piwik PRO _paq queue missing, init() not run");const f=e=>{u.push(e)},l=t.settings||{},d=!1!==l.linkTracking,p=e=>{f(e),d&&!Y.has(i)&&(Y.add(i),f(["enableLinkTracking"]))},g=n.settings||{},{goalId:y}=g,m=!n.name&&"page view"===e.name,w=n.name?e.name:m?"trackPageView":void 0;if(void 0===w&&void 0===y)return void Q(c,`${s}|${e.name}|unmapped`,`Event "${e.name}" skipped: no rule name, no goal and not a page view`,{event:e.name,reason:"unmapped"});const h=!0===n.silent?void 0:w,b=void 0!==h&&(O=h,z.some(e=>e===O))?h:void 0;var O;if(void 0===h&&void 0===y)return void Q(c,`${s}|${e.name}|silent`,`Event "${e.name}" skipped: silent rule without a goal`,{event:e.name,reason:"silent"});const k=void 0===h?[]:m&&void 0===n.data?[await $(e,"data.title",{collector:i})]:function(e){return void 0===e?[]:v(e)?[...e]:[e]}(r),j=void 0!==y||void 0!==b,P=j?await M(l.customDimensions,e,i):{},R=j?await M(g.customDimensions,e,i):{},E=void 0===y||void 0===g.goalValue?void 0:await $(e,g.goalValue,{collector:i});if(K(i,B(l.identified,i,e)).forEach(f),void 0!==h)if(void 0===b)f([h,...te(k)]);else if(void 0===H[b]){const{before:e,after:t}=function(e,t){const n=U({...e,...t});if(0===Object.keys(t).length)return{before:n,after:[]};const r={};for(const[n,o]of Object.entries(t))Object.prototype.hasOwnProperty.call(e,n)||void 0===o||(r[n]=void 0);return{before:n,after:[...U(r),...U(e)]}}(P,R);e.forEach(f),p([b,...te(k)]),t.forEach(f)}else p([b,...te(ee(b,k,P,R))]);void 0!==y&&p(["trackGoal",...te(ee("trackGoal",[y,E],P,R))])}};function ee(e,t,n,r){const o=H[e];if(void 0===o)return t;const i=function(e,t,n){const r={};for(const[n,o]of G({...e,...t})){const e=void 0===o?void 0:L(o);void 0!==e&&(r[`dimension${n}`]=e)}if(w(n))for(const[e,t]of Object.entries(n))q.test(e)&&null!=t&&(r[e]=String(t));return r}(n,r,t[o]),c=0===Object.keys(i).length;if(c&&o>=t.length)return t;const s=[...t];for(;s.length<o;)s.push(void 0);return s[o]=c?void 0:i,s}function te(e){let t=e.length;for(;t>0&&void 0===e[t-1];)t--;return e.slice(0,t)}var ne,re=Z;return ne=o,((o,i,c,s)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let a of n(i))r.call(o,a)||a===c||e(o,a,{get:()=>i[a],enumerable:!(s=t(i,a))||s.enumerable});return o})(e({},"__esModule",{value:!0}),ne)})();
|
package/dist/index.es5.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _array_like_to_array(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _array_with_holes(e){if(Array.isArray(e))return e}function _array_without_holes(e){if(Array.isArray(e))return _array_like_to_array(e)}function _assert_this_initialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function asyncGeneratorStep(e,t,r,n,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}function _async_to_generator(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){asyncGeneratorStep(a,n,o,i,c,"next",e)}function c(e){asyncGeneratorStep(a,n,o,i,c,"throw",e)}i(void 0)})}}function _call_super(e,t,r){return t=_get_prototype_of(t),_possible_constructor_return(e,_is_native_reflect_construct()?Reflect.construct(t,r||[],_get_prototype_of(e).constructor):t.apply(e,r))}function _class_call_check(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _construct(e,t,r){return _construct=_is_native_reflect_construct()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&_set_prototype_of(o,r.prototype),o},_construct.apply(null,arguments)}function _define_property(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _get_prototype_of(e){return _get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_get_prototype_of(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_set_prototype_of(e,t)}function _instanceof(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function _is_native_function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function _iterable_to_array(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterable_to_array_limit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,c=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){c=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(c)throw o}}return a}}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){_define_property(e,t,r[t])})}return e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _object_spread_props(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function _possible_constructor_return(e,t){return!t||"object"!==_type_of(t)&&"function"!=typeof t?_assert_this_initialized(e):t}function _set_prototype_of(e,t){return _set_prototype_of=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_set_prototype_of(e,t)}function _sliced_to_array(e,t){return _array_with_holes(e)||_iterable_to_array_limit(e,t)||_unsupported_iterable_to_array(e,t)||_non_iterable_rest()}function _to_consumable_array(e){return _array_without_holes(e)||_iterable_to_array(e)||_unsupported_iterable_to_array(e)||_non_iterable_spread()}function _type_of(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function _unsupported_iterable_to_array(e,t){if(e){if("string"==typeof e)return _array_like_to_array(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array(e,t):void 0}}function _wrap_native_super(e){var t="function"==typeof Map?new Map:void 0;return _wrap_native_super=function(e){if(null===e||!_is_native_function(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return _construct(e,arguments,_get_prototype_of(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_set_prototype_of(r,e)},_wrap_native_super(e)}function _is_native_reflect_construct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_is_native_reflect_construct=function(){return!!e})()}function _ts_generator(e,t){var r,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(i,"next",{value:u(0)}),c(i,"throw",{value:u(1)}),c(i,"return",{value:u(2)}),"function"==typeof Symbol&&c(i,Symbol.iterator,{value:function(){return this}}),i;function u(c){return function(u){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}var Destination=function(){var e=function(e,t){if("collector"===e)return"collector";if(!t)throw new Error("stepId(".concat(e,") requires an id"));return"".concat(e,".").concat(t)},t=function(e,t){var r=e.destinations[t];if(!r)throw new Error("Destination not found: ".concat(t));return r},r=function(e,t){var r=e.transformers[t];if(!r)throw new Error("Transformer not found: ".concat(t));return r},n=function(e,t){var r=e.sources[t];if(!r)throw new Error("Source not found: ".concat(t));return r},o=function(e,t){var r=e.stores[t];if(!r)throw new Error("Store not found: ".concat(t));return r},a=function(e,t){return _async_to_generator(function(){return _ts_generator(this,function(r){switch(r.label){case 0:return[4,e.get(t)];case 1:return[2,r.sent()]}})})()},i=function(e){return Array.isArray(e)},c=function(e){return void 0!==e},u=function(e){return"object"==(void 0===e?"undefined":_type_of(e))&&null!==e&&"then"in e&&"function"==typeof e.then},l=function(e){return"object"==(void 0===e?"undefined":_type_of(e))&&null!==e&&!i(e)&&"[object Object]"===Object.prototype.toString.call(e)},s=function(e){return"string"==typeof e},f=function(e){var t=_object_spread({},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),r={},n=!e||0===Object.keys(e).length;return Object.keys(t).forEach(function(o){t[o]&&(r[o]=!0,e&&e[o]&&(n=!0))}),!!n&&r},_=function(e){return B(e)?e:void 0},p=function(e,t,r){return function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return _async_to_generator(function(){var n;return _ts_generator(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,4,6]),[4,e.apply(void 0,_to_consumable_array(o))];case 1:case 3:return[2,a.sent()];case 2:return n=a.sent(),t?[4,t(n)]:[2];case 4:return[4,null==r?void 0:r()];case 5:return a.sent(),[7];case 6:return[2]}})})()}},y=function(e){return _async_to_generator(function(e){var t,r,n,o,a,u,l,s,f,_,y,v,d,b,h,g,m=arguments;return _ts_generator(this,function(w){switch(w.label){case 0:if(t=m.length>1&&void 0!==m[1]?m[1]:{},a=(r=m.length>2&&void 0!==m[2]?m[2]:{}).consent||(null===(o=r.collector)||void 0===o?void 0:o.consent),u=null!==(n=r.event)&&void 0!==n?n:{},!r.collector)throw new Error("getMappingValue: context.collector is required");l={event:u,mapping:t,collector:r.collector,logger:r.collector.logger,consent:a},s=i(t)?t:[t],f=!0,_=!1,y=void 0,w.label=1;case 1:w.trys.push([1,6,7,8]),v=s[Symbol.iterator](),w.label=2;case 2:return(f=(d=v.next()).done)?[3,5]:(b=d.value,[4,p(K,function(e){if(_instanceof(e,F))throw e;r.collector&&r.collector.status.failed++,l.logger.error("mapping processing failed",{event:u,error:e})})(e,b,_object_spread_props(_object_spread({},l),{mapping:b}))]);case 3:if(h=w.sent(),c(h))return[2,h];w.label=4;case 4:return f=!0,[3,2];case 5:return[3,8];case 6:return g=w.sent(),_=!0,y=g,[3,8];case 7:try{f||null==v.return||v.return()}finally{if(_)throw y}return[7];case 8:return[2]}})}).apply(this,arguments)},v=function(e){return _async_to_generator(function(e){var t,r,n,o,a,i,u=arguments;return _ts_generator(this,function(s){return t=u.length>1&&void 0!==u[1]?u[1]:{},r=u.length>2&&void 0!==u[2]?u[2]:{},c(e)?(a=l(e)&&e.consent||r.consent||(null===(o=r.collector)||void 0===o?void 0:o.consent),i=null!==(n=r.event)&&void 0!==n?n:l(e)?e:{},[2,y(e,t,_object_spread_props(_object_spread({},r),{consent:a,event:i}))]):[2]})}).apply(this,arguments)},d=function(e){var t=(e.startsWith($)?e.slice(5):e).split(".");return t.some(function(e){return""===e})?[]:t},b=function(e){return"function"==typeof e},h=function(e){return"object"==(void 0===e?"undefined":_type_of(e))&&null!==e},g=function(e,t){if(-1!==H.indexOf(t))return!1;for(var r=e;b(r);){if(Object.prototype.hasOwnProperty.call(r,t))return!0;var n=Object.getPrototypeOf(r);if(!b(n)||!b(Object.getPrototypeOf(n)))return!1;r=n}return!1},m=function(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);return!(r&&!r.configurable)||"value"in r&&!0===r.writable},w=function(e,t){var r=e,n=!0,o=!1,a=void 0;try{for(var i,c=t[Symbol.iterator]();!(n=(i=c.next()).done);n=!0){var l=i.value;if(b(r)){if(!g(r,l))return!0;if(!m(r,l))return!1}else if(u(r)){if(!(l in r))return!0}else if(!h(r)||!(l in r))return!1;r=Reflect.get(r,l)}}catch(e){o=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw a}}return b(r)},O=function(e){var t=_object_spread({window:"undefined"!=typeof window?window:globalThis.window,document:"undefined"!=typeof document?document:globalThis.document},e),r=e&&e[z];if(("undefined"==typeof __WALKEROS_OBSERVE__||__WALKEROS_OBSERVE__)&&function(e){if("object"!=(void 0===e?"undefined":_type_of(e))||null===e)return!1;if(!("paths"in e)||!("record"in e))return!1;var t=e.paths,r=e.record;return Array.isArray(t)&&t.every(function(e){return"string"==typeof e})&&"function"==typeof r}(r)){delete t[z];var n=function(e,t,r){var n=[],o=[],a=[],i=!0,c=!1,l=void 0;try{for(var s,f=t[Symbol.iterator]();!(i=(s=f.next()).done);i=!0){var _=s.value,p=d(_);if(0!==p.length){var y=p.join(".");a.push({rest:p,fn:y}),w(e,p)||o.push(y)}}}catch(e){c=!0,l=e}finally{try{i||null==f.return||f.return()}finally{if(c)throw l}}var v=new WeakMap,O=new WeakSet;function j(e,t){var o=!0,a=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(o=(c=u.next()).done);o=!0){var l=c.value;if(r)try{r(l,t)}catch(e){}else n.push({fn:l,args:t,ts:Date.now()})}}catch(e){a=!0,i=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw i}}}function S(e,t){return 0===t.length||P(e)?e:u(e)&&!t.some(function(t){return t.rest[0]in e})?Promise.resolve(e).then(function(e){return S(e,t)}):b(e)?D(e,[],t):h(e)?E(e,t):e}function P(e){return(h(e)||b(e))&&O.has(e)}function k(e,t){var r=[],n=[],o=!0,a=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(o=(c=u.next()).done);o=!0){var l=c.value;l.rest[0]===t&&(1===l.rest.length?r.includes(l.fn)||r.push(l.fn):n.push({rest:l.rest.slice(1),fn:l.fn}))}}catch(e){a=!0,i=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw i}}return{leafs:r,deeper:n}}function E(e,t){var r,n=t.map(function(e){return"".concat(e.fn,":").concat(e.rest.join("."))}).join("|"),o=null!==(r=v.get(e))&&void 0!==r?r:new Map;v.set(e,o);var a=o.get(n);if(a)return a;var i=R(e,t);return o.set(n,i),i}function R(e,t){return b(e)?x(e,t):t.some(function(t){return!m(e,t.rest[0])})?function(e,t){var r=Object.create(Object.getPrototypeOf(e)),n=A(e,t,function(){return o}),o=new Proxy(r,{get:function(e,t){return n.get(t)},set:function(t,r,n){return Reflect.set(e,r,n,e)},has:function(t,r){return Reflect.has(e,r)},ownKeys:function(){return Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(t,r){var n=Reflect.getOwnPropertyDescriptor(e,r);return n&&_object_spread_props(_object_spread({},n),{configurable:!0})},defineProperty:function(t,r,n){return Reflect.defineProperty(e,r,n)},deleteProperty:function(t,r){return Reflect.deleteProperty(e,r)}});return O.add(o),o}(e,t):x(e,t)}function x(e,t){var r=A(e,t,function(){return n}),n=new Proxy(e,{get:function(e,t){return"string"!=typeof t||m(e,t)?r.get(t):Reflect.get(e,t,e)},set:function(e,t,r){return Reflect.set(e,t,r,e)}});return O.add(n),n}function A(e,t,r){var n=new Map;return{get:function(o){var a=Reflect.get(e,o,e);if("string"!=typeof o)return a;if(!b(a)&&!h(a))return a;if(P(a))return a;var i=n.get(o);if(i&&i.value===a)return i.out;var c=k(t,o),u=c.leafs,l=c.deeper;if(!(u.length>0||l.length>0)&&(!b(a)||function(e){if(Array.isArray(e))return!0;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}(e)))return a;var s=a;return b(a)?s=D(a,u,l,{proxy:r(),target:e}):l.length>0&&(s=E(a,l)),n.set(o,{value:a,out:s}),s}}}function D(e,t,r,n){var o=function(){return r.filter(function(t){return!g(e,t.rest[0])})},a=new Map,i=new Proxy(e,{get:function(e,t){var n=Reflect.get(e,t,e);if("string"!=typeof t||!m(e,t))return n;if(!g(e,t))return n;var o=k(r,t),c=o.leafs,u=o.deeper;if(0===c.length&&0===u.length)return n;if(P(n))return n;var l=a.get(t);if(l&&l.value===n)return l.out;var s=n;return b(n)?s=D(n,c,u,{proxy:i,target:e}):h(n)&&u.length>0&&(s=E(n,u)),a.set(t,{value:n,out:s}),s},set:function(e,t,r){return Reflect.set(e,t,r,e)},apply:function(e,r,a){j(t,a);var i=!n||r!==n.proxy&&void 0!==r?r:n.target;return S(Reflect.apply(e,i,a),o())},construct:function(e,r,n){j(t,r);var a=Reflect.construct(e,r,n===i?e:n),c=S(a,o());return h(c)||b(c)?c:a}});return O.add(i),i}return{env:R(e,a),calls:n,unresolved:o}}(t,r.paths,r.record).env,o=new Set,a=!0,i=!1,c=void 0;try{for(var l,s=r.paths[Symbol.iterator]();!(a=(l=s.next()).done);a=!0){var f=l.value,_=d(f)[0];if(void 0!==_){var p=t[_];null!==p&&"object"==(void 0===p?"undefined":_type_of(p))&&o.add(_)}}}catch(e){i=!0,c=e}finally{try{a||null==s.return||s.return()}finally{if(i)throw c}}var y=Array.from(o,function(e){return[e,n[e]]}),v=!0,O=!1,j=void 0;try{for(var S,P=y[Symbol.iterator]();!(v=(S=P.next()).done);v=!0){var k=_sliced_to_array(S.value,2),E=k[0],R=k[1];t[E]=R}}catch(e){O=!0,j=e}finally{try{v||null==P.return||P.return()}finally{if(O)throw j}}}return t},j=function(e,t,r){return _async_to_generator(function(){var n,o,a,i,c,u,l,s,f,_,p;return _ts_generator(this,function(y){switch(y.label){case 0:if(n={},!e)return[2,n];o=!0,a=!1,i=void 0,y.label=1;case 1:y.trys.push([1,6,7,8]),c=Object.entries(e)[Symbol.iterator](),y.label=2;case 2:return(o=(u=c.next()).done)?[3,5]:(l=_sliced_to_array(u.value,2),s=l[0],f=l[1],[4,v(t,f,{collector:r})]);case 3:_=y.sent(),n[s]=null==_?void 0:String(_),y.label=4;case 4:return o=!0,[3,2];case 5:return[3,8];case 6:return p=y.sent(),a=!0,i=p,[3,8];case 7:try{o||null==c.return||c.return()}finally{if(a)throw i}return[7];case 8:return[2,n]}})})()},S=function(e){return P(e).map(function(e){var t=_sliced_to_array(e,2),r=t[0],n=t[1];return void 0===n?["deleteCustomDimension",Number(r)]:["setCustomDimensionValue",Number(r),n]})},P=function(e){return Object.entries(e).filter(function(e){var t=_sliced_to_array(e,1)[0];return Q.test(t)}).sort(function(e,t){var r=_sliced_to_array(e,1)[0],n=_sliced_to_array(t,1)[0];return Number(r)-Number(n)})},k=function(e){try{return encodeURIComponent(e)}catch(e){return}},E=function(e,t,r){return void 0===e||!0===e||!1!==e&&!1!==f(e,t.consent,null==r?void 0:r.consent)},R=function(e,t){var r,n=null===(r=X.get(e))||void 0===r||r;return X.set(e,t),n===t?[]:t?[["enableCookies"],["deanonymizeUser"]]:[["disableCookies"],["deleteCookies"],["setUserIsAnonymous",!0]]},x=function(e,t,r,n){if(!te.has(t)&&te.size<ee)return te.add(t),void e.warn(r,n);e.debug(r,n)},A=function(e,t,r,n){var o=Z[e];if(void 0===o)return t;var a=function(e,t,r){var n={},o=!0,a=!1,i=void 0;try{for(var c,u=P(_object_spread({},e,t))[Symbol.iterator]();!(o=(c=u.next()).done);o=!0){var s=_sliced_to_array(c.value,2),f=s[0],_=s[1],p=void 0===_?void 0:k(_);void 0!==p&&(n["dimension".concat(f)]=p)}}catch(e){a=!0,i=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw i}}if(l(r)){var y=!0,v=!1,d=void 0;try{for(var b,h=Object.entries(r)[Symbol.iterator]();!(y=(b=h.next()).done);y=!0){var g=_sliced_to_array(b.value,2),m=g[0],w=g[1];J.test(m)&&null!=w&&(n[m]=String(w))}}catch(e){v=!0,d=e}finally{try{y||null==h.return||h.return()}finally{if(v)throw d}}}return n}(r,n,t[o]),i=0===Object.keys(a).length;if(i&&o>=t.length)return t;for(var c=_to_consumable_array(t);c.length<o;)c.push(void 0);return c[o]=i?void 0:a,c},D=function(e){for(var t=e.length;t>0&&void 0===e[t-1];)t--;return e.slice(0,t)},I=Object.defineProperty,C=Object.getOwnPropertyDescriptor,T=Object.getOwnPropertyNames,N=Object.prototype.hasOwnProperty,G={};!function(e,t){for(var r in t)I(e,r,{get:t[r],enumerable:!0})}(G,{DestinationPiwikPro:function(){return re},default:function(){return ae},destinationPiwikPro:function(){return oe}});var M=Object.defineProperty,V=function(e,t){for(var r in t)M(e,r,{get:t[r],enumerable:!0})};V({},{stepId:function(){return e}});V({},{getDestination:function(){return t}});V({},{Level:function(){return q}});var W,q=((W=q||{})[W.ERROR=0]="ERROR",W[W.WARN=1]="WARN",W[W.INFO=2]="INFO",W[W.DEBUG=3]="DEBUG",W);V({},{getTransformer:function(){return r}});V({},{getSource:function(){return n}});function U(e){for(var t=arguments.length>2?arguments[2]:void 0,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"").split("."),n=e,o=0;o<r.length;o++){var a=r[o];if("*"===a&&i(n)){var u=r.slice(o+1).join("."),s=[],f=!0,_=!1,p=void 0;try{for(var y,v=n[Symbol.iterator]();!(f=(y=v.next()).done);f=!0){var d=U(y.value,u,t);s.push(d)}}catch(e){_=!0,p=e}finally{try{f||null==v.return||v.return()}finally{if(_)throw p}}return s}if(void 0===(n=l(n)||i(n)?n[a]:void 0))break}return c(n)?n:t}function B(e){return function(e){return"boolean"==typeof e}(e)||s(e)||function(e){return"number"==typeof e&&!Number.isNaN(e)}(e)||!c(e)||i(e)&&e.every(B)||l(e)&&Object.values(e).every(B)}V({},{getStore:function(){return o},getStoreValue:function(){return a}});var F=function(){function e(t,r){var n;return _class_call_check(this,e),(n=_call_super(this,e,[t,r])).name="FatalError",Object.setPrototypeOf(n,e.prototype),n}return _inherits(e,_wrap_native_super(Error)),e}();function K(e,t,r){return _async_to_generator(function(){return _ts_generator(this,function(n){return[2,(i(t)?t:[t]).reduce(function(t,n){return _async_to_generator(function(){var o,a,u,l,v,d,b,h,g,m,w,O,j,S,P,k,E,R,x,A,D,I,C,T,N;return _ts_generator(this,function(G){switch(G.label){case 0:return[4,t];case 1:return(o=G.sent())?[2,o]:(a=s(n)?{key:n}:n,Object.keys(a).length?(u=a.condition,l=a.consent,v=a.fn,d=a.key,b=a.loop,h=a.map,g=a.set,m=a.validate,w=a.value,O=_object_spread_props(_object_spread({},r),{mapping:n}),(j=u)?[4,p(u,function(e){if(_instanceof(e,F))throw e;return O.logger.error("mapping condition failed",{event:O.event,error:e}),!1})(e,O)]:[3,3]):[2]);case 2:j=!G.sent(),G.label=3;case 3:return j?[2]:l&&!f(l,O.consent)?[2,w]:(S=c(w)?w:e,b?(P=_sliced_to_array(b,2),k=P[0],E=P[1],"this"!==k?[3,4]:(x=[e],[3,6])):[3,10]);case 4:return[4,y(e,k,O)];case 5:x=G.sent(),G.label=6;case 6:return i(R=x)?[4,Promise.all(R.map(function(e){return c(e)?y(e,E,O):void 0}))]:[3,8];case 7:return A=G.sent().filter(c),[3,9];case 8:A=void 0,G.label=9;case 9:return S=A,[3,21];case 10:return h?[4,Object.entries(h).reduce(function(t,r){var n=_sliced_to_array(r,2),o=n[0],a=n[1];return _async_to_generator(function(){var r,n;return _ts_generator(this,function(i){switch(i.label){case 0:return[4,t];case 1:return r=i.sent(),[4,y(e,a,O)];case 2:return n=i.sent(),[2,(c(n)&&(r[o]=n),r)]}})})()},Promise.resolve({}))]:[3,12];case 11:return S=G.sent(),[3,20];case 12:return g?[4,Promise.all(g.map(function(t){return K(e,t,O)}))]:[3,14];case 13:return D=S=G.sent(),[3,19];case 14:return d?(I=S=U(e,d,w),[3,18]):[3,15];case 15:return(C=v)?[4,p(v,function(e){if(_instanceof(e,F))throw e;O.logger.error("mapping fn failed",{event:O.event,error:e})})(e,O)]:[3,17];case 16:C=S=G.sent(),G.label=17;case 17:I=C,G.label=18;case 18:D=I,G.label=19;case 19:G.label=20;case 20:G.label=21;case 21:return(T=m)?[4,p(m,function(e){if(_instanceof(e,F))throw e;return O.logger.error("mapping validate failed",{event:O.event,error:e}),!1})(S,O)]:[3,23];case 22:T=!G.sent(),G.label=23;case 23:return T&&(S=void 0),N=_(S),[2,c(N)?N:_(w)]}})})()},Promise.resolve(void 0))]})})()}var L,z="observe",$="call:",H=["name","length","prototype","arguments","caller"],J=/^dimension\d+$/,Q=/^\d+$/,X=new WeakMap,Y=["trackPageView","trackEvent","trackGoal","trackSiteSearch","trackLink","trackContentImpression","trackContentInteraction","ecommerceProductDetailView","ecommerceAddToCart","ecommerceRemoveFromCart","ecommerceCartUpdate","ecommerceOrder","ping"],Z={trackEvent:4,trackGoal:2,trackSiteSearch:3,trackLink:2},ee=1e3,te=new Set,re={},ne=new WeakSet,oe={type:"piwikpro",config:{},init:function(e){var t=e.config,r=e.env,n=e.logger,o=e.collector,a=O(r).window,i=t.settings,c=void 0===i?{}:i,u=t.loadScript,l=c.appId,s=c.url;a._paq=a._paq||[];var f=a._paq,_=function(e){f.push(e)};if(u){if(!l)return n.throw("Config settings appId missing");if(!s)return n.throw("Config settings url missing");var p=function(e){return"".concat(e.replace(/\/+$/,""),"/")}(s);!function(e,t){var r=O(t).document,n=r.createElement("script");n.type="text/javascript",n.src=e+"ppms.js",n.async=!0,n.defer=!0,r.head.appendChild(n)}(p,r),_(["setTrackerUrl",p+"ppms.php"]),_(["setSiteId",l])}E(c.identified,o)||R(o,!1).forEach(_)},push:function(e,t){return _async_to_generator(function(e,t){var r,n,o,a,c,u,l,s,f,_,p,y,d,b,h,g,m,w,P,k,I,C,T,N,G,M,V,W,q,U,B,F,K,L;return _ts_generator(this,function(z){switch(z.label){case 0:return r=t.config,n=t.rule,o=void 0===n?{}:n,a=t.data,c=t.env,u=t.collector,l=t.logger,s=t.id,f=O(c),_=f.window,(p=_._paq)?(y=function(e){p.push(e)},d=r.settings||{},b=!1!==d.linkTracking,h=function(e){y(e),b&&!ne.has(u)&&(ne.add(u),y(["enableLinkTracking"]))},g=o.settings||{},m=g.goalId,w=!o.name&&"page view"===e.name,void 0===(P=o.name?e.name:w?"trackPageView":void 0)&&void 0===m?(x(l,"".concat(s,"|").concat(e.name,"|unmapped"),'Event "'.concat(e.name,'" skipped: no rule name, no goal and not a page view'),{event:e.name,reason:"unmapped"}),[2]):(k=!0===o.silent?void 0:P,I=void 0!==k&&($=k,Y.some(function(e){return e===$}))?k:void 0,void 0===k&&void 0===m?(x(l,"".concat(s,"|").concat(e.name,"|silent"),'Event "'.concat(e.name,'" skipped: silent rule without a goal'),{event:e.name,reason:"silent"}),[2]):void 0!==k?[3,1]:(T=[],[3,5]))):(l.warn("Piwik PRO _paq queue missing, init() not run"),[2]);case 1:return w&&void 0===o.data?[4,v(e,"data.title",{collector:u})]:[3,3];case 2:return N=[z.sent()],[3,4];case 3:N=function(e){return void 0===e?[]:i(e)?_to_consumable_array(e):[e]}(a),z.label=4;case 4:T=N,z.label=5;case 5:return C=T,(G=void 0!==m||void 0!==I)?[4,j(d.customDimensions,e,u)]:[3,7];case 6:return V=z.sent(),[3,8];case 7:V={},z.label=8;case 8:return M=V,G?[4,j(g.customDimensions,e,u)]:[3,10];case 9:return q=z.sent(),[3,11];case 10:q={},z.label=11;case 11:return W=q,void 0!==m&&void 0!==g.goalValue?[3,12]:(B=void 0,[3,14]);case 12:return[4,v(e,g.goalValue,{collector:u})];case 13:B=z.sent(),z.label=14;case 14:return U=B,R(u,E(d.identified,u,e)).forEach(y),void 0!==k&&(void 0===I?y([k].concat(_to_consumable_array(D(C)))):void 0===Z[I]?(F=function(e,t){var r=S(_object_spread({},e,t));if(0===Object.keys(t).length)return{before:r,after:[]};var n={},o=!0,a=!1,i=void 0;try{for(var c,u=Object.entries(t)[Symbol.iterator]();!(o=(c=u.next()).done);o=!0){var l=_sliced_to_array(c.value,2),s=l[0],f=l[1];Object.prototype.hasOwnProperty.call(e,s)||void 0===f||(n[s]=void 0)}}catch(e){a=!0,i=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw i}}return{before:r,after:_to_consumable_array(S(n)).concat(_to_consumable_array(S(e)))}}(M,W),K=F.before,L=F.after,K.forEach(y),h([I].concat(_to_consumable_array(D(C)))),L.forEach(y)):h([I].concat(_to_consumable_array(D(A(I,C,M,W)))))),void 0!==m&&h(["trackGoal"].concat(_to_consumable_array(D(A("trackGoal",[m,U],M,W))))),[2]}var $})}).apply(this,arguments)}},ae=oe;return L=G,function(e,t,r,n){if(t&&"object"===(void 0===t?"undefined":_type_of(t))||"function"==typeof t){var o=!0,a=!1,i=void 0;try{for(var c,u=function(){var o=c.value;N.call(e,o)||o===r||I(e,o,{get:function(){return t[o]},enumerable:!(n=C(t,o))||n.enumerable})},l=T(t)[Symbol.iterator]();!(o=(c=l.next()).done);o=!0)u()}catch(e){a=!0,i=e}finally{try{o||null==l.return||l.return()}finally{if(a)throw i}}}return e}(I({},"__esModule",{value:!0}),L)}();
|
|
1
|
+
"use strict";function _array_like_to_array(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _array_with_holes(e){if(Array.isArray(e))return e}function _array_without_holes(e){if(Array.isArray(e))return _array_like_to_array(e)}function _assert_this_initialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function asyncGeneratorStep(e,t,r,n,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}function _async_to_generator(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){asyncGeneratorStep(a,n,o,i,c,"next",e)}function c(e){asyncGeneratorStep(a,n,o,i,c,"throw",e)}i(void 0)})}}function _call_super(e,t,r){return t=_get_prototype_of(t),_possible_constructor_return(e,_is_native_reflect_construct()?Reflect.construct(t,r||[],_get_prototype_of(e).constructor):t.apply(e,r))}function _class_call_check(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _construct(e,t,r){return _construct=_is_native_reflect_construct()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&_set_prototype_of(o,r.prototype),o},_construct.apply(null,arguments)}function _define_property(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _get_prototype_of(e){return _get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_get_prototype_of(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_set_prototype_of(e,t)}function _instanceof(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function _is_native_function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function _iterable_to_array(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterable_to_array_limit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,c=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){c=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(c)throw o}}return a}}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){_define_property(e,t,r[t])})}return e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _object_spread_props(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function _possible_constructor_return(e,t){return!t||"object"!==_type_of(t)&&"function"!=typeof t?_assert_this_initialized(e):t}function _set_prototype_of(e,t){return _set_prototype_of=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_set_prototype_of(e,t)}function _sliced_to_array(e,t){return _array_with_holes(e)||_iterable_to_array_limit(e,t)||_unsupported_iterable_to_array(e,t)||_non_iterable_rest()}function _to_consumable_array(e){return _array_without_holes(e)||_iterable_to_array(e)||_unsupported_iterable_to_array(e)||_non_iterable_spread()}function _type_of(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function _unsupported_iterable_to_array(e,t){if(e){if("string"==typeof e)return _array_like_to_array(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array(e,t):void 0}}function _wrap_native_super(e){var t="function"==typeof Map?new Map:void 0;return _wrap_native_super=function(e){if(null===e||!_is_native_function(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return _construct(e,arguments,_get_prototype_of(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_set_prototype_of(r,e)},_wrap_native_super(e)}function _is_native_reflect_construct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_is_native_reflect_construct=function(){return!!e})()}function _ts_generator(e,t){var r,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(i,"next",{value:u(0)}),c(i,"throw",{value:u(1)}),c(i,"return",{value:u(2)}),"function"==typeof Symbol&&c(i,Symbol.iterator,{value:function(){return this}}),i;function u(c){return function(u){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}var Destination=function(){var e=function(e,t){if("collector"===e)return"collector";if(!t)throw new Error("stepId(".concat(e,") requires an id"));return"".concat(e,".").concat(t)},t=function(e,t){var r=e.destinations[t];if(!r)throw new Error("Destination not found: ".concat(t));return r},r=function(e,t){var r=e.transformers[t];if(!r)throw new Error("Transformer not found: ".concat(t));return r},n=function(e,t){var r=e.sources[t];if(!r)throw new Error("Source not found: ".concat(t));return r},o=function(e,t){var r=e.stores[t];if(!r)throw new Error("Store not found: ".concat(t));return r},a=function(e,t){return _async_to_generator(function(){return _ts_generator(this,function(r){switch(r.label){case 0:return[4,e.get(t)];case 1:return[2,r.sent()]}})})()},i=function(e){return Array.isArray(e)},c=function(e){return void 0!==e},u=function(e){return"object"==(void 0===e?"undefined":_type_of(e))&&null!==e&&"then"in e&&"function"==typeof e.then},l=function(e){return"object"==(void 0===e?"undefined":_type_of(e))&&null!==e&&!i(e)&&"[object Object]"===Object.prototype.toString.call(e)},s=function(e){return"string"==typeof e},f=function(e){var t=_object_spread({},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),r={},n=!e||0===Object.keys(e).length;return Object.keys(t).forEach(function(o){t[o]&&(r[o]=!0,e&&e[o]&&(n=!0))}),!!n&&r},_=function(e){return B(e)?e:void 0},p=function(e,t,r){return function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return _async_to_generator(function(){var n;return _ts_generator(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,4,6]),[4,e.apply(void 0,_to_consumable_array(o))];case 1:case 3:return[2,a.sent()];case 2:return n=a.sent(),t?[4,t(n)]:[2];case 4:return[4,null==r?void 0:r()];case 5:return a.sent(),[7];case 6:return[2]}})})()}},y=function(e,t){return _async_to_generator(function(e){var t,r,n,o,a,u,l,s,f,_,y,v,d,b,h,g=arguments;return _ts_generator(this,function(m){switch(m.label){case 0:if(t=g.length>1&&void 0!==g[1]?g[1]:{},!(r=g.length>2?g[2]:void 0).collector)throw new Error("getMappingValue: context.collector is required");o=r.consent||r.collector.consent,a=null!==(n=r.event)&&void 0!==n?n:{},u={event:a,mapping:t,collector:r.collector,logger:r.collector.logger,consent:o},l=i(t)?t:[t],s=!0,f=!1,_=void 0,m.label=1;case 1:m.trys.push([1,6,7,8]),y=l[Symbol.iterator](),m.label=2;case 2:return(s=(v=y.next()).done)?[3,5]:(d=v.value,[4,p(K,function(e){if(_instanceof(e,F))throw e;r.collector.status.failed++,u.logger.error("mapping processing failed",{event:a,error:e})})(e,d,_object_spread_props(_object_spread({},u),{mapping:d}))]);case 3:if(b=m.sent(),c(b))return[2,b];m.label=4;case 4:return s=!0,[3,2];case 5:return[3,8];case 6:return h=m.sent(),f=!0,_=h,[3,8];case 7:try{s||null==y.return||y.return()}finally{if(f)throw _}return[7];case 8:return[2]}})}).apply(this,arguments)},v=function(e,t){return _async_to_generator(function(e){var t,r,n,o,a,i,u=arguments;return _ts_generator(this,function(s){return t=u.length>1&&void 0!==u[1]?u[1]:{},r=u.length>2?u[2]:void 0,c(e)?(a=l(e)&&e.consent||(null==r?void 0:r.consent)||(null==r||null===(o=r.collector)||void 0===o?void 0:o.consent),i=null!==(n=null==r?void 0:r.event)&&void 0!==n?n:l(e)?e:{},[2,y(e,t,_object_spread_props(_object_spread({},r),{consent:a,event:i}))]):[2]})}).apply(this,arguments)},d=function(e){var t=(e.startsWith($)?e.slice(5):e).split(".");return t.some(function(e){return""===e})?[]:t},b=function(e){return"function"==typeof e},h=function(e){return"object"==(void 0===e?"undefined":_type_of(e))&&null!==e},g=function(e,t){if(-1!==H.indexOf(t))return!1;for(var r=e;b(r);){if(Object.prototype.hasOwnProperty.call(r,t))return!0;var n=Object.getPrototypeOf(r);if(!b(n)||!b(Object.getPrototypeOf(n)))return!1;r=n}return!1},m=function(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);return!(r&&!r.configurable)||"value"in r&&!0===r.writable},w=function(e,t){var r=e,n=!0,o=!1,a=void 0;try{for(var i,c=t[Symbol.iterator]();!(n=(i=c.next()).done);n=!0){var l=i.value;if(b(r)){if(!g(r,l))return!0;if(!m(r,l))return!1}else if(u(r)){if(!(l in r))return!0}else if(!h(r)||!(l in r))return!1;r=Reflect.get(r,l)}}catch(e){o=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw a}}return b(r)},O=function(e){var t=_object_spread({window:"undefined"!=typeof window?window:globalThis.window,document:"undefined"!=typeof document?document:globalThis.document},e),r=e&&e[z];if(("undefined"==typeof __WALKEROS_OBSERVE__||__WALKEROS_OBSERVE__)&&function(e){if("object"!=(void 0===e?"undefined":_type_of(e))||null===e)return!1;if(!("paths"in e)||!("record"in e))return!1;var t=e.paths,r=e.record;return Array.isArray(t)&&t.every(function(e){return"string"==typeof e})&&"function"==typeof r}(r)){delete t[z];var n=function(e,t,r){var n=[],o=[],a=[],i=!0,c=!1,l=void 0;try{for(var s,f=t[Symbol.iterator]();!(i=(s=f.next()).done);i=!0){var _=s.value,p=d(_);if(0!==p.length){var y=p.join(".");a.push({rest:p,fn:y}),w(e,p)||o.push(y)}}}catch(e){c=!0,l=e}finally{try{i||null==f.return||f.return()}finally{if(c)throw l}}var v=new WeakMap,O=new WeakSet;function j(e,t){var o=!0,a=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(o=(c=u.next()).done);o=!0){var l=c.value;if(r)try{r(l,t)}catch(e){}else n.push({fn:l,args:t,ts:Date.now()})}}catch(e){a=!0,i=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw i}}}function S(e,t){return 0===t.length||P(e)?e:u(e)&&!t.some(function(t){return t.rest[0]in e})?Promise.resolve(e).then(function(e){return S(e,t)}):b(e)?D(e,[],t):h(e)?E(e,t):e}function P(e){return(h(e)||b(e))&&O.has(e)}function k(e,t){var r=[],n=[],o=!0,a=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(o=(c=u.next()).done);o=!0){var l=c.value;l.rest[0]===t&&(1===l.rest.length?r.includes(l.fn)||r.push(l.fn):n.push({rest:l.rest.slice(1),fn:l.fn}))}}catch(e){a=!0,i=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw i}}return{leafs:r,deeper:n}}function E(e,t){var r,n=t.map(function(e){return"".concat(e.fn,":").concat(e.rest.join("."))}).join("|"),o=null!==(r=v.get(e))&&void 0!==r?r:new Map;v.set(e,o);var a=o.get(n);if(a)return a;var i=R(e,t);return o.set(n,i),i}function R(e,t){return b(e)?x(e,t):t.some(function(t){return!m(e,t.rest[0])})?function(e,t){var r=Object.create(Object.getPrototypeOf(e)),n=A(e,t,function(){return o}),o=new Proxy(r,{get:function(e,t){return n.get(t)},set:function(t,r,n){return Reflect.set(e,r,n,e)},has:function(t,r){return Reflect.has(e,r)},ownKeys:function(){return Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(t,r){var n=Reflect.getOwnPropertyDescriptor(e,r);return n&&_object_spread_props(_object_spread({},n),{configurable:!0})},defineProperty:function(t,r,n){return Reflect.defineProperty(e,r,n)},deleteProperty:function(t,r){return Reflect.deleteProperty(e,r)}});return O.add(o),o}(e,t):x(e,t)}function x(e,t){var r=A(e,t,function(){return n}),n=new Proxy(e,{get:function(e,t){return"string"!=typeof t||m(e,t)?r.get(t):Reflect.get(e,t,e)},set:function(e,t,r){return Reflect.set(e,t,r,e)}});return O.add(n),n}function A(e,t,r){var n=new Map;return{get:function(o){var a=Reflect.get(e,o,e);if("string"!=typeof o)return a;if(!b(a)&&!h(a))return a;if(P(a))return a;var i=n.get(o);if(i&&i.value===a)return i.out;var c=k(t,o),u=c.leafs,l=c.deeper;if(!(u.length>0||l.length>0)&&(!b(a)||function(e){if(Array.isArray(e))return!0;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}(e)))return a;var s=a;return b(a)?s=D(a,u,l,{proxy:r(),target:e}):l.length>0&&(s=E(a,l)),n.set(o,{value:a,out:s}),s}}}function D(e,t,r,n){var o=function(){return r.filter(function(t){return!g(e,t.rest[0])})},a=new Map,i=new Proxy(e,{get:function(e,t){var n=Reflect.get(e,t,e);if("string"!=typeof t||!m(e,t))return n;if(!g(e,t))return n;var o=k(r,t),c=o.leafs,u=o.deeper;if(0===c.length&&0===u.length)return n;if(P(n))return n;var l=a.get(t);if(l&&l.value===n)return l.out;var s=n;return b(n)?s=D(n,c,u,{proxy:i,target:e}):h(n)&&u.length>0&&(s=E(n,u)),a.set(t,{value:n,out:s}),s},set:function(e,t,r){return Reflect.set(e,t,r,e)},apply:function(e,r,a){j(t,a);var i=!n||r!==n.proxy&&void 0!==r?r:n.target;return S(Reflect.apply(e,i,a),o())},construct:function(e,r,n){j(t,r);var a=Reflect.construct(e,r,n===i?e:n),c=S(a,o());return h(c)||b(c)?c:a}});return O.add(i),i}return{env:R(e,a),calls:n,unresolved:o}}(t,r.paths,r.record).env,o=new Set,a=!0,i=!1,c=void 0;try{for(var l,s=r.paths[Symbol.iterator]();!(a=(l=s.next()).done);a=!0){var f=l.value,_=d(f)[0];if(void 0!==_){var p=t[_];null!==p&&"object"==(void 0===p?"undefined":_type_of(p))&&o.add(_)}}}catch(e){i=!0,c=e}finally{try{a||null==s.return||s.return()}finally{if(i)throw c}}var y=Array.from(o,function(e){return[e,n[e]]}),v=!0,O=!1,j=void 0;try{for(var S,P=y[Symbol.iterator]();!(v=(S=P.next()).done);v=!0){var k=_sliced_to_array(S.value,2),E=k[0],R=k[1];t[E]=R}}catch(e){O=!0,j=e}finally{try{v||null==P.return||P.return()}finally{if(O)throw j}}}return t},j=function(e,t,r){return _async_to_generator(function(){var n,o,a,i,c,u,l,s,f,_,p;return _ts_generator(this,function(y){switch(y.label){case 0:if(n={},!e)return[2,n];o=!0,a=!1,i=void 0,y.label=1;case 1:y.trys.push([1,6,7,8]),c=Object.entries(e)[Symbol.iterator](),y.label=2;case 2:return(o=(u=c.next()).done)?[3,5]:(l=_sliced_to_array(u.value,2),s=l[0],f=l[1],[4,v(t,f,{collector:r})]);case 3:_=y.sent(),n[s]=null==_?void 0:String(_),y.label=4;case 4:return o=!0,[3,2];case 5:return[3,8];case 6:return p=y.sent(),a=!0,i=p,[3,8];case 7:try{o||null==c.return||c.return()}finally{if(a)throw i}return[7];case 8:return[2,n]}})})()},S=function(e){return P(e).map(function(e){var t=_sliced_to_array(e,2),r=t[0],n=t[1];return void 0===n?["deleteCustomDimension",Number(r)]:["setCustomDimensionValue",Number(r),n]})},P=function(e){return Object.entries(e).filter(function(e){var t=_sliced_to_array(e,1)[0];return Q.test(t)}).sort(function(e,t){var r=_sliced_to_array(e,1)[0],n=_sliced_to_array(t,1)[0];return Number(r)-Number(n)})},k=function(e){try{return encodeURIComponent(e)}catch(e){return}},E=function(e,t,r){return void 0===e||!0===e||!1!==e&&!1!==f(e,t.consent,null==r?void 0:r.consent)},R=function(e,t){var r,n=null===(r=X.get(e))||void 0===r||r;return X.set(e,t),n===t?[]:t?[["enableCookies"],["deanonymizeUser"]]:[["disableCookies"],["deleteCookies"],["setUserIsAnonymous",!0]]},x=function(e,t,r,n){if(!te.has(t)&&te.size<ee)return te.add(t),void e.warn(r,n);e.debug(r,n)},A=function(e,t,r,n){var o=Z[e];if(void 0===o)return t;var a=function(e,t,r){var n={},o=!0,a=!1,i=void 0;try{for(var c,u=P(_object_spread({},e,t))[Symbol.iterator]();!(o=(c=u.next()).done);o=!0){var s=_sliced_to_array(c.value,2),f=s[0],_=s[1],p=void 0===_?void 0:k(_);void 0!==p&&(n["dimension".concat(f)]=p)}}catch(e){a=!0,i=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw i}}if(l(r)){var y=!0,v=!1,d=void 0;try{for(var b,h=Object.entries(r)[Symbol.iterator]();!(y=(b=h.next()).done);y=!0){var g=_sliced_to_array(b.value,2),m=g[0],w=g[1];J.test(m)&&null!=w&&(n[m]=String(w))}}catch(e){v=!0,d=e}finally{try{y||null==h.return||h.return()}finally{if(v)throw d}}}return n}(r,n,t[o]),i=0===Object.keys(a).length;if(i&&o>=t.length)return t;for(var c=_to_consumable_array(t);c.length<o;)c.push(void 0);return c[o]=i?void 0:a,c},D=function(e){for(var t=e.length;t>0&&void 0===e[t-1];)t--;return e.slice(0,t)},I=Object.defineProperty,C=Object.getOwnPropertyDescriptor,T=Object.getOwnPropertyNames,N=Object.prototype.hasOwnProperty,G={};!function(e,t){for(var r in t)I(e,r,{get:t[r],enumerable:!0})}(G,{DestinationPiwikPro:function(){return re},default:function(){return ae},destinationPiwikPro:function(){return oe}});var M=Object.defineProperty,V=function(e,t){for(var r in t)M(e,r,{get:t[r],enumerable:!0})};V({},{stepId:function(){return e}});V({},{getDestination:function(){return t}});V({},{Level:function(){return q}});var W,q=((W=q||{})[W.ERROR=0]="ERROR",W[W.WARN=1]="WARN",W[W.INFO=2]="INFO",W[W.DEBUG=3]="DEBUG",W);V({},{getTransformer:function(){return r}});V({},{getSource:function(){return n}});function U(e){for(var t=arguments.length>2?arguments[2]:void 0,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"").split("."),n=e,o=0;o<r.length;o++){var a=r[o];if("*"===a&&i(n)){var u=r.slice(o+1).join("."),s=[],f=!0,_=!1,p=void 0;try{for(var y,v=n[Symbol.iterator]();!(f=(y=v.next()).done);f=!0){var d=U(y.value,u,t);s.push(d)}}catch(e){_=!0,p=e}finally{try{f||null==v.return||v.return()}finally{if(_)throw p}}return s}if(void 0===(n=l(n)||i(n)?n[a]:void 0))break}return c(n)?n:t}function B(e){return function(e){return"boolean"==typeof e}(e)||s(e)||function(e){return"number"==typeof e&&!Number.isNaN(e)}(e)||!c(e)||i(e)&&e.every(B)||l(e)&&Object.values(e).every(B)}V({},{getStore:function(){return o},getStoreValue:function(){return a}});var F=function(){function e(t,r){var n;return _class_call_check(this,e),(n=_call_super(this,e,[t,r])).name="FatalError",Object.setPrototypeOf(n,e.prototype),n}return _inherits(e,_wrap_native_super(Error)),e}();function K(e,t,r){return _async_to_generator(function(){return _ts_generator(this,function(n){return[2,(i(t)?t:[t]).reduce(function(t,n){return _async_to_generator(function(){var o,a,u,l,v,d,b,h,g,m,w,O,j,S,P,k,E,R,x,A,D,I,C,T,N;return _ts_generator(this,function(G){switch(G.label){case 0:return[4,t];case 1:return(o=G.sent())?[2,o]:(a=s(n)?{key:n}:n,Object.keys(a).length?(u=a.condition,l=a.consent,v=a.fn,d=a.key,b=a.loop,h=a.map,g=a.set,m=a.validate,w=a.value,O=_object_spread_props(_object_spread({},r),{mapping:n}),(j=u)?[4,p(u,function(e){if(_instanceof(e,F))throw e;return O.logger.error("mapping condition failed",{event:O.event,error:e}),!1})(e,O)]:[3,3]):[2]);case 2:j=!G.sent(),G.label=3;case 3:return j?[2]:l&&!f(l,O.consent)?[2,w]:(S=c(w)?w:e,b?(P=_sliced_to_array(b,2),k=P[0],E=P[1],"this"!==k?[3,4]:(x=[e],[3,6])):[3,10]);case 4:return[4,y(e,k,O)];case 5:x=G.sent(),G.label=6;case 6:return i(R=x)?[4,Promise.all(R.map(function(e){return c(e)?y(e,E,O):void 0}))]:[3,8];case 7:return A=G.sent().filter(c),[3,9];case 8:A=void 0,G.label=9;case 9:return S=A,[3,21];case 10:return h?[4,Object.entries(h).reduce(function(t,r){var n=_sliced_to_array(r,2),o=n[0],a=n[1];return _async_to_generator(function(){var r,n;return _ts_generator(this,function(i){switch(i.label){case 0:return[4,t];case 1:return r=i.sent(),[4,y(e,a,O)];case 2:return n=i.sent(),[2,(c(n)&&(r[o]=n),r)]}})})()},Promise.resolve({}))]:[3,12];case 11:return S=G.sent(),[3,20];case 12:return g?[4,Promise.all(g.map(function(t){return K(e,t,O)}))]:[3,14];case 13:return D=S=G.sent(),[3,19];case 14:return d?(I=S=U(e,d,w),[3,18]):[3,15];case 15:return(C=v)?[4,p(v,function(e){if(_instanceof(e,F))throw e;O.logger.error("mapping fn failed",{event:O.event,error:e})})(e,O)]:[3,17];case 16:C=S=G.sent(),G.label=17;case 17:I=C,G.label=18;case 18:D=I,G.label=19;case 19:G.label=20;case 20:G.label=21;case 21:return(T=m)?[4,p(m,function(e){if(_instanceof(e,F))throw e;return O.logger.error("mapping validate failed",{event:O.event,error:e}),!1})(S,O)]:[3,23];case 22:T=!G.sent(),G.label=23;case 23:return T&&(S=void 0),N=_(S),[2,c(N)?N:_(w)]}})})()},Promise.resolve(void 0))]})})()}var L,z="observe",$="call:",H=["name","length","prototype","arguments","caller"],J=/^dimension\d+$/,Q=/^\d+$/,X=new WeakMap,Y=["trackPageView","trackEvent","trackGoal","trackSiteSearch","trackLink","trackContentImpression","trackContentInteraction","ecommerceProductDetailView","ecommerceAddToCart","ecommerceRemoveFromCart","ecommerceCartUpdate","ecommerceOrder","ping"],Z={trackEvent:4,trackGoal:2,trackSiteSearch:3,trackLink:2},ee=1e3,te=new Set,re={},ne=new WeakSet,oe={type:"piwikpro",config:{},init:function(e){var t=e.config,r=e.env,n=e.logger,o=e.collector,a=O(r).window,i=t.settings,c=void 0===i?{}:i,u=t.loadScript,l=c.appId,s=c.url;a._paq=a._paq||[];var f=a._paq,_=function(e){f.push(e)};if(u){if(!l)return n.throw("Config settings appId missing");if(!s)return n.throw("Config settings url missing");var p=function(e){return"".concat(e.replace(/\/+$/,""),"/")}(s);!function(e,t){var r=O(t).document,n=r.createElement("script");n.type="text/javascript",n.src=e+"ppms.js",n.async=!0,n.defer=!0,r.head.appendChild(n)}(p,r),_(["setTrackerUrl",p+"ppms.php"]),_(["setSiteId",l])}E(c.identified,o)||R(o,!1).forEach(_)},push:function(e,t){return _async_to_generator(function(e,t){var r,n,o,a,c,u,l,s,f,_,p,y,d,b,h,g,m,w,P,k,I,C,T,N,G,M,V,W,q,U,B,F,K,L;return _ts_generator(this,function(z){switch(z.label){case 0:return r=t.config,n=t.rule,o=void 0===n?{}:n,a=t.data,c=t.env,u=t.collector,l=t.logger,s=t.id,f=O(c),_=f.window,(p=_._paq)?(y=function(e){p.push(e)},d=r.settings||{},b=!1!==d.linkTracking,h=function(e){y(e),b&&!ne.has(u)&&(ne.add(u),y(["enableLinkTracking"]))},g=o.settings||{},m=g.goalId,w=!o.name&&"page view"===e.name,void 0===(P=o.name?e.name:w?"trackPageView":void 0)&&void 0===m?(x(l,"".concat(s,"|").concat(e.name,"|unmapped"),'Event "'.concat(e.name,'" skipped: no rule name, no goal and not a page view'),{event:e.name,reason:"unmapped"}),[2]):(k=!0===o.silent?void 0:P,I=void 0!==k&&($=k,Y.some(function(e){return e===$}))?k:void 0,void 0===k&&void 0===m?(x(l,"".concat(s,"|").concat(e.name,"|silent"),'Event "'.concat(e.name,'" skipped: silent rule without a goal'),{event:e.name,reason:"silent"}),[2]):void 0!==k?[3,1]:(T=[],[3,5]))):(l.warn("Piwik PRO _paq queue missing, init() not run"),[2]);case 1:return w&&void 0===o.data?[4,v(e,"data.title",{collector:u})]:[3,3];case 2:return N=[z.sent()],[3,4];case 3:N=function(e){return void 0===e?[]:i(e)?_to_consumable_array(e):[e]}(a),z.label=4;case 4:T=N,z.label=5;case 5:return C=T,(G=void 0!==m||void 0!==I)?[4,j(d.customDimensions,e,u)]:[3,7];case 6:return V=z.sent(),[3,8];case 7:V={},z.label=8;case 8:return M=V,G?[4,j(g.customDimensions,e,u)]:[3,10];case 9:return q=z.sent(),[3,11];case 10:q={},z.label=11;case 11:return W=q,void 0!==m&&void 0!==g.goalValue?[3,12]:(B=void 0,[3,14]);case 12:return[4,v(e,g.goalValue,{collector:u})];case 13:B=z.sent(),z.label=14;case 14:return U=B,R(u,E(d.identified,u,e)).forEach(y),void 0!==k&&(void 0===I?y([k].concat(_to_consumable_array(D(C)))):void 0===Z[I]?(F=function(e,t){var r=S(_object_spread({},e,t));if(0===Object.keys(t).length)return{before:r,after:[]};var n={},o=!0,a=!1,i=void 0;try{for(var c,u=Object.entries(t)[Symbol.iterator]();!(o=(c=u.next()).done);o=!0){var l=_sliced_to_array(c.value,2),s=l[0],f=l[1];Object.prototype.hasOwnProperty.call(e,s)||void 0===f||(n[s]=void 0)}}catch(e){a=!0,i=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw i}}return{before:r,after:_to_consumable_array(S(n)).concat(_to_consumable_array(S(e)))}}(M,W),K=F.before,L=F.after,K.forEach(y),h([I].concat(_to_consumable_array(D(C)))),L.forEach(y)):h([I].concat(_to_consumable_array(D(A(I,C,M,W)))))),void 0!==m&&h(["trackGoal"].concat(_to_consumable_array(D(A("trackGoal",[m,U],M,W))))),[2]}var $})}).apply(this,arguments)}},ae=oe;return L=G,function(e,t,r,n){if(t&&"object"===(void 0===t?"undefined":_type_of(t))||"function"==typeof t){var o=!0,a=!1,i=void 0;try{for(var c,u=function(){var o=c.value;N.call(e,o)||o===r||I(e,o,{get:function(){return t[o]},enumerable:!(n=C(t,o))||n.enumerable})},l=T(t)[Symbol.iterator]();!(o=(c=l.next()).done);o=!0)u()}catch(e){a=!0,i=e}finally{try{o||null==l.return||l.return()}finally{if(a)throw i}}}return e}(I({},"__esModule",{value:!0}),L)}();
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/web-destination-piwikpro",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.8.0-next-1791496487198",
|
|
5
5
|
"type": "destination",
|
|
6
6
|
"platform": [
|
|
7
7
|
"web"
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
],
|
|
247
|
-
"description": "Identified or anonymous tracking. true (default) identifies every hit, false switches the tracker to anonymous mode without cookies (disableCookies, deleteCookies, setUserIsAnonymous) at init. A consent object like { marketing: true } identifies only while that consent is granted and calls enableCookies and deanonymizeUser once it is. Do not repeat these states in config.consent,
|
|
247
|
+
"description": "Identified or anonymous tracking. true (default) identifies every hit, false switches the tracker to anonymous mode without cookies (disableCookies, deleteCookies, setUserIsAnonymous) at init. A consent object like { marketing: true } identifies only while that consent is granted and calls enableCookies and deanonymizeUser once it is. Do not repeat these states in config.consent: a destination needs only one of its config.consent states granted, so next to another state the repeated one lets events through on its own, and as the only state it queues every event until granted, so no anonymous hit is sent."
|
|
248
248
|
},
|
|
249
249
|
"customDimensions": {
|
|
250
250
|
"type": "object",
|
|
@@ -496,7 +496,7 @@
|
|
|
496
496
|
"consent": {
|
|
497
497
|
"functional": true
|
|
498
498
|
},
|
|
499
|
-
"id": "
|
|
499
|
+
"id": "c79a36ed11bee010",
|
|
500
500
|
"trigger": "load",
|
|
501
501
|
"entity": "cart",
|
|
502
502
|
"action": "view",
|
|
@@ -518,7 +518,7 @@
|
|
|
518
518
|
"nested",
|
|
519
519
|
{
|
|
520
520
|
"condition": {
|
|
521
|
-
"$code": "e
|
|
521
|
+
"$code": "e=>\"object\"==typeof e&&null!==e&&\"entity\"in e&&\"product\"===e.entity"
|
|
522
522
|
},
|
|
523
523
|
"map": {
|
|
524
524
|
"sku": "data.id",
|
|
@@ -595,7 +595,7 @@
|
|
|
595
595
|
"consent": {
|
|
596
596
|
"functional": true
|
|
597
597
|
},
|
|
598
|
-
"id": "
|
|
598
|
+
"id": "12b428f5a45b15bb",
|
|
599
599
|
"trigger": "click",
|
|
600
600
|
"entity": "product",
|
|
601
601
|
"action": "add",
|
|
@@ -680,7 +680,7 @@
|
|
|
680
680
|
"consent": {
|
|
681
681
|
"functional": true
|
|
682
682
|
},
|
|
683
|
-
"id": "
|
|
683
|
+
"id": "b1213ea18be881ad",
|
|
684
684
|
"trigger": "load",
|
|
685
685
|
"entity": "page",
|
|
686
686
|
"action": "view",
|
|
@@ -753,7 +753,7 @@
|
|
|
753
753
|
"consent": {
|
|
754
754
|
"functional": true
|
|
755
755
|
},
|
|
756
|
-
"id": "
|
|
756
|
+
"id": "77c73549da10e5f8",
|
|
757
757
|
"trigger": "visible",
|
|
758
758
|
"entity": "promotion",
|
|
759
759
|
"action": "visible",
|
|
@@ -823,7 +823,7 @@
|
|
|
823
823
|
"consent": {
|
|
824
824
|
"functional": true
|
|
825
825
|
},
|
|
826
|
-
"id": "
|
|
826
|
+
"id": "f177f2766d1ab5ee",
|
|
827
827
|
"trigger": "click",
|
|
828
828
|
"entity": "product",
|
|
829
829
|
"action": "add",
|
|
@@ -963,7 +963,7 @@
|
|
|
963
963
|
"consent": {
|
|
964
964
|
"functional": true
|
|
965
965
|
},
|
|
966
|
-
"id": "
|
|
966
|
+
"id": "606fb7bfd9881a6a",
|
|
967
967
|
"trigger": "load",
|
|
968
968
|
"entity": "order",
|
|
969
969
|
"action": "complete",
|
|
@@ -985,7 +985,7 @@
|
|
|
985
985
|
"nested",
|
|
986
986
|
{
|
|
987
987
|
"condition": {
|
|
988
|
-
"$code": "e
|
|
988
|
+
"$code": "e=>\"object\"==typeof e&&null!==e&&\"entity\"in e&&\"product\"===e.entity"
|
|
989
989
|
},
|
|
990
990
|
"map": {
|
|
991
991
|
"sku": "data.id",
|
|
@@ -1090,7 +1090,7 @@
|
|
|
1090
1090
|
"consent": {
|
|
1091
1091
|
"functional": true
|
|
1092
1092
|
},
|
|
1093
|
-
"id": "
|
|
1093
|
+
"id": "61ff8772374ac25c",
|
|
1094
1094
|
"trigger": "test",
|
|
1095
1095
|
"entity": "product",
|
|
1096
1096
|
"action": "remove",
|
|
@@ -1222,7 +1222,7 @@
|
|
|
1222
1222
|
"consent": {
|
|
1223
1223
|
"functional": true
|
|
1224
1224
|
},
|
|
1225
|
-
"id": "
|
|
1225
|
+
"id": "4f4c135c33ebe565",
|
|
1226
1226
|
"trigger": "load",
|
|
1227
1227
|
"entity": "order",
|
|
1228
1228
|
"action": "complete",
|
|
@@ -1330,7 +1330,7 @@
|
|
|
1330
1330
|
"consent": {
|
|
1331
1331
|
"functional": true
|
|
1332
1332
|
},
|
|
1333
|
-
"id": "
|
|
1333
|
+
"id": "f4d9ddc836193adb",
|
|
1334
1334
|
"trigger": "test",
|
|
1335
1335
|
"entity": "file",
|
|
1336
1336
|
"action": "download",
|
|
@@ -1403,7 +1403,7 @@
|
|
|
1403
1403
|
"consent": {
|
|
1404
1404
|
"functional": true
|
|
1405
1405
|
},
|
|
1406
|
-
"id": "
|
|
1406
|
+
"id": "0c06d12d57e4cdda",
|
|
1407
1407
|
"trigger": "load",
|
|
1408
1408
|
"entity": "page",
|
|
1409
1409
|
"action": "view",
|
|
@@ -1467,7 +1467,7 @@
|
|
|
1467
1467
|
"consent": {
|
|
1468
1468
|
"functional": true
|
|
1469
1469
|
},
|
|
1470
|
-
"id": "
|
|
1470
|
+
"id": "80d34b64a26cad64",
|
|
1471
1471
|
"trigger": "load",
|
|
1472
1472
|
"entity": "page",
|
|
1473
1473
|
"action": "view",
|
|
@@ -1537,7 +1537,7 @@
|
|
|
1537
1537
|
"consent": {
|
|
1538
1538
|
"functional": true
|
|
1539
1539
|
},
|
|
1540
|
-
"id": "
|
|
1540
|
+
"id": "5df971b621552b89",
|
|
1541
1541
|
"trigger": "load",
|
|
1542
1542
|
"entity": "page",
|
|
1543
1543
|
"action": "view",
|
|
@@ -1603,7 +1603,7 @@
|
|
|
1603
1603
|
"consent": {
|
|
1604
1604
|
"functional": true
|
|
1605
1605
|
},
|
|
1606
|
-
"id": "
|
|
1606
|
+
"id": "56bdab94be5ef31d",
|
|
1607
1607
|
"trigger": "pulse",
|
|
1608
1608
|
"entity": "page",
|
|
1609
1609
|
"action": "ping",
|
|
@@ -1658,7 +1658,7 @@
|
|
|
1658
1658
|
"consent": {
|
|
1659
1659
|
"functional": true
|
|
1660
1660
|
},
|
|
1661
|
-
"id": "
|
|
1661
|
+
"id": "972b9a29dcff4757",
|
|
1662
1662
|
"trigger": "load",
|
|
1663
1663
|
"entity": "product",
|
|
1664
1664
|
"action": "view",
|
|
@@ -1756,7 +1756,7 @@
|
|
|
1756
1756
|
"consent": {
|
|
1757
1757
|
"functional": true
|
|
1758
1758
|
},
|
|
1759
|
-
"id": "
|
|
1759
|
+
"id": "3fcd6c6576f69430",
|
|
1760
1760
|
"trigger": "test",
|
|
1761
1761
|
"entity": "search",
|
|
1762
1762
|
"action": "submit",
|
|
@@ -1792,7 +1792,7 @@
|
|
|
1792
1792
|
},
|
|
1793
1793
|
"hints": {
|
|
1794
1794
|
"identified-consent": {
|
|
1795
|
-
"text": "settings.identified controls identified or anonymous tracking. Absent or true: identified, the Piwik PRO default. false: anonymous from init, without tracker cookies (disableCookies, deleteCookies, setUserIsAnonymous(true)). A consent object like { \"marketing\": true }: anonymous and cookieless until that consent is granted, then enableCookies and deanonymizeUser merge the anonymous session into the identified visitor. Keep config.consent for the states that gate tracking at all
|
|
1795
|
+
"text": "settings.identified controls identified or anonymous tracking. Absent or true: identified, the Piwik PRO default. false: anonymous from init, without tracker cookies (disableCookies, deleteCookies, setUserIsAnonymous(true)). A consent object like { \"marketing\": true }: anonymous and cookieless until that consent is granted, then enableCookies and deanonymizeUser merge the anonymous session into the identified visitor. Keep config.consent for the states that gate tracking at all and do not repeat the identified states there: a destination needs only one of its config.consent states granted, so next to another state the repeated one lets events through on its own, and as the only state it queues every event until granted, so no anonymous hit is sent.",
|
|
1796
1796
|
"code": [
|
|
1797
1797
|
{
|
|
1798
1798
|
"lang": "json",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/web-destination-piwikpro",
|
|
3
3
|
"description": "Piwik PRO destination for walkerOS",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.8.0-next-1791496487198",
|
|
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.
|
|
42
|
-
"@walkeros/web-core": "4.
|
|
41
|
+
"@walkeros/core": "4.8.0-next-1791496487198",
|
|
42
|
+
"@walkeros/web-core": "4.8.0-next-1791496487198"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@walkeros/collector": "4.
|
|
45
|
+
"@walkeros/collector": "4.8.0-next-1791496487198"
|
|
46
46
|
},
|
|
47
47
|
"repository": {
|
|
48
48
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|