[{"data":1,"prerenderedAt":2978},["ShallowReactive",2],{"navigation_docs":3,"-tracking-javascript":188,"-tracking-javascript-surround":2973},[4,23,52,81,134,148,166],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":22},"Getting started","i-lucide-rocket","/getting-started","1.getting-started",[10,14,18],{"title":11,"path":12,"stem":13},"Introduction","/getting-started/introduction","1.getting-started/1.introduction",{"title":15,"path":16,"stem":17},"Quickstart","/getting-started/quickstart","1.getting-started/2.quickstart",{"title":19,"path":20,"stem":21},"Core concepts","/getting-started/concepts","1.getting-started/3.concepts",false,{"title":24,"icon":25,"path":26,"stem":27,"children":28,"page":22},"API and agents","i-lucide-bot","/api-agents","10.api-agents",[29,33,36,40,44,48],{"title":30,"path":31,"stem":32},"Overview","/api-agents/overview","10.api-agents/1.overview",{"title":15,"path":34,"stem":35},"/api-agents/quickstart","10.api-agents/2.quickstart",{"title":37,"path":38,"stem":39},"Tools reference","/api-agents/tools-reference","10.api-agents/3.tools-reference",{"title":41,"path":42,"stem":43},"SEO × GEO playbook","/api-agents/playbook-seo-geo","10.api-agents/4.playbook-seo-geo",{"title":45,"path":46,"stem":47},"Scopes and error codes","/api-agents/scopes-and-errors","10.api-agents/5.scopes-and-errors",{"title":49,"path":50,"stem":51},"CLI reference","/api-agents/cli-reference","10.api-agents/6.cli-reference",{"title":53,"icon":54,"path":55,"stem":56,"children":57,"page":22},"Tracking","i-lucide-chart-line","/tracking","2.tracking",[58,61,65,69,73,77],{"title":30,"path":59,"stem":60},"/tracking/overview","2.tracking/1.overview",{"title":62,"path":63,"stem":64},"JavaScript SDK","/tracking/javascript","2.tracking/2.javascript",{"title":66,"path":67,"stem":68},"Google Tag Manager","/tracking/google-tag-manager","2.tracking/3.google-tag-manager",{"title":70,"path":71,"stem":72},"Events reference","/tracking/events","2.tracking/4.events",{"title":74,"path":75,"stem":76},"Event schema","/tracking/event-schema","2.tracking/5.event-schema",{"title":78,"path":79,"stem":80},"First-party tracking domain","/tracking/first-party-domain","2.tracking/6.first-party-domain",{"title":82,"icon":83,"path":84,"stem":85,"children":86,"page":22},"Connectors","i-lucide-plug","/connectors","3.connectors",[87,90,94,98,102,106,110,114,118,122,126,130],{"title":30,"path":88,"stem":89},"/connectors/overview","3.connectors/1.overview",{"title":91,"path":92,"stem":93},"Cloudflare AI crawlers","/connectors/cloudflare-ai-crawlers","3.connectors/10.cloudflare-ai-crawlers",{"title":95,"path":96,"stem":97},"Content change webhooks","/connectors/content-change-webhooks","3.connectors/11.content-change-webhooks",{"title":99,"path":100,"stem":101},"Shopify","/connectors/shopify","3.connectors/12.shopify",{"title":103,"path":104,"stem":105},"Google Ads","/connectors/google-ads","3.connectors/2.google-ads",{"title":107,"path":108,"stem":109},"Meta Ads","/connectors/meta-ads","3.connectors/3.meta-ads",{"title":111,"path":112,"stem":113},"TikTok Ads","/connectors/tiktok-ads","3.connectors/4.tiktok-ads",{"title":115,"path":116,"stem":117},"LinkedIn Ads","/connectors/linkedin-ads","3.connectors/5.linkedin-ads",{"title":119,"path":120,"stem":121},"Pinterest Ads","/connectors/pinterest-ads","3.connectors/6.pinterest-ads",{"title":123,"path":124,"stem":125},"Custom webhooks","/connectors/webhooks","3.connectors/7.webhooks",{"title":127,"path":128,"stem":129},"PrestaShop","/connectors/prestashop","3.connectors/8.prestashop",{"title":131,"path":132,"stem":133},"WooCommerce","/connectors/woocommerce","3.connectors/9.woocommerce",{"title":135,"icon":136,"path":137,"stem":138,"children":139,"page":22},"Analytics","i-lucide-layout-dashboard","/analytics","4.analytics",[140,144],{"title":141,"path":142,"stem":143},"Dashboard overview","/analytics/overview","4.analytics/1.overview",{"title":145,"path":146,"stem":147},"Metrics reference","/analytics/metrics","4.analytics/2.metrics",{"title":149,"icon":150,"path":151,"stem":152,"children":153,"page":22},"Attribution","i-lucide-git-fork","/attribution","5.attribution",[154,158,162],{"title":155,"path":156,"stem":157},"How attribution works","/attribution/overview","5.attribution/1.overview",{"title":159,"path":160,"stem":161},"Data-driven model","/attribution/data-driven","5.attribution/2.data-driven",{"title":163,"path":164,"stem":165},"Attribution windows","/attribution/windows","5.attribution/3.windows",{"title":167,"icon":168,"path":169,"stem":170,"children":171,"page":22},"Trust Center","i-lucide-shield-check","/trust-center","6.trust-center",[172,176,180,184],{"title":173,"path":174,"stem":175},"Trust Center overview","/trust-center/overview","6.trust-center/1.overview",{"title":177,"path":178,"stem":179},"Investigations","/trust-center/investigations","6.trust-center/2.investigations",{"title":181,"path":182,"stem":183},"Audits","/trust-center/audits","6.trust-center/3.audits",{"title":185,"path":186,"stem":187},"Alerts","/trust-center/alerts","6.trust-center/4.alerts",{"id":189,"title":62,"body":190,"description":2967,"extension":2968,"links":2969,"meta":2970,"navigation":693,"path":63,"seo":2971,"stem":64,"__hash__":2972},"docs/2.tracking/2.javascript.md",{"type":191,"value":192,"toc":2943},"minimark",[193,198,203,212,536,542,546,556,623,638,642,836,840,958,984,988,991,1095,1101,1105,1108,1230,1234,1244,1339,1345,1348,1391,1434,1437,1441,1444,1543,1550,1606,1609,1632,1636,1639,1671,1674,1678,1681,1727,1734,1738,1741,1897,1931,1935,1938,1956,1960,1967,1977,2027,2031,2044,2087,2091,2094,2138,2141,2149,2162,2166,2173,2247,2254,2304,2363,2367,2370,2548,2633,2637,2640,2939],[194,195,197],"h2",{"id":196},"installation","Installation",[199,200,202],"h3",{"id":201},"standard-installation","Standard installation",[204,205,206,207,211],"p",{},"Add this snippet before the closing ",[208,209,210],"code",{},"\u003C/head>"," tag:",[213,214,219],"pre",{"className":215,"code":216,"language":217,"meta":218,"style":218},"language-html shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003Cscript>\n(function(w,d,s,u,n){\n  w[n]=w[n]||[];\n  w[n].push(['init','ATTRIBUTION_ID',{sendPageView:true}]);\n  var f=d.getElementsByTagName(s)[0],j=d.createElement(s);\n  j.async=1;j.src=u;f.parentNode.insertBefore(j,f);\n})(window,document,'script','https://t.trustdata.tech/t.js','trustdata');\n\u003C/script>\n","html","",[208,220,221,237,278,312,372,426,483,526],{"__ignoreMap":218},[222,223,226,230,234],"span",{"class":224,"line":225},"line",1,[222,227,229],{"class":228},"sMK4o","\u003C",[222,231,233],{"class":232},"swJcz","script",[222,235,236],{"class":228},">\n",[222,238,240,244,248,250,254,257,260,262,265,267,270,272,275],{"class":224,"line":239},2,[222,241,243],{"class":242},"sTEyZ","(",[222,245,247],{"class":246},"spNyl","function",[222,249,243],{"class":228},[222,251,253],{"class":252},"sHdIc","w",[222,255,256],{"class":228},",",[222,258,259],{"class":252},"d",[222,261,256],{"class":228},[222,263,264],{"class":252},"s",[222,266,256],{"class":228},[222,268,269],{"class":252},"u",[222,271,256],{"class":228},[222,273,274],{"class":252},"n",[222,276,277],{"class":228},"){\n",[222,279,281,284,287,289,292,295,297,299,301,303,306,309],{"class":224,"line":280},3,[222,282,283],{"class":242},"  w",[222,285,286],{"class":232},"[",[222,288,274],{"class":242},[222,290,291],{"class":232},"]",[222,293,294],{"class":228},"=",[222,296,253],{"class":242},[222,298,286],{"class":232},[222,300,274],{"class":242},[222,302,291],{"class":232},[222,304,305],{"class":228},"||",[222,307,308],{"class":232},"[]",[222,310,311],{"class":228},";\n",[222,313,315,317,319,321,323,326,330,333,336,340,342,344,346,349,351,354,357,360,364,367,370],{"class":224,"line":314},4,[222,316,283],{"class":242},[222,318,286],{"class":232},[222,320,274],{"class":242},[222,322,291],{"class":232},[222,324,325],{"class":228},".",[222,327,329],{"class":328},"s2Zo4","push",[222,331,332],{"class":232},"([",[222,334,335],{"class":228},"'",[222,337,339],{"class":338},"sfazB","init",[222,341,335],{"class":228},[222,343,256],{"class":228},[222,345,335],{"class":228},[222,347,348],{"class":338},"ATTRIBUTION_ID",[222,350,335],{"class":228},[222,352,353],{"class":228},",{",[222,355,356],{"class":232},"sendPageView",[222,358,359],{"class":228},":",[222,361,363],{"class":362},"sfNiH","true",[222,365,366],{"class":228},"}",[222,368,369],{"class":232},"])",[222,371,311],{"class":228},[222,373,375,378,381,383,385,387,390,392,394,397,401,403,405,408,410,412,414,417,419,421,424],{"class":224,"line":374},5,[222,376,377],{"class":246},"  var",[222,379,380],{"class":242}," f",[222,382,294],{"class":228},[222,384,259],{"class":242},[222,386,325],{"class":228},[222,388,389],{"class":328},"getElementsByTagName",[222,391,243],{"class":232},[222,393,264],{"class":242},[222,395,396],{"class":232},")[",[222,398,400],{"class":399},"sbssI","0",[222,402,291],{"class":232},[222,404,256],{"class":228},[222,406,407],{"class":242},"j",[222,409,294],{"class":228},[222,411,259],{"class":242},[222,413,325],{"class":228},[222,415,416],{"class":328},"createElement",[222,418,243],{"class":232},[222,420,264],{"class":242},[222,422,423],{"class":232},")",[222,425,311],{"class":228},[222,427,429,432,434,437,439,442,445,447,449,452,454,456,458,461,463,466,468,471,473,475,477,479,481],{"class":224,"line":428},6,[222,430,431],{"class":242},"  j",[222,433,325],{"class":228},[222,435,436],{"class":242},"async",[222,438,294],{"class":228},[222,440,441],{"class":399},"1",[222,443,444],{"class":228},";",[222,446,407],{"class":242},[222,448,325],{"class":228},[222,450,451],{"class":242},"src",[222,453,294],{"class":228},[222,455,269],{"class":242},[222,457,444],{"class":228},[222,459,460],{"class":242},"f",[222,462,325],{"class":228},[222,464,465],{"class":242},"parentNode",[222,467,325],{"class":228},[222,469,470],{"class":328},"insertBefore",[222,472,243],{"class":232},[222,474,407],{"class":242},[222,476,256],{"class":228},[222,478,460],{"class":242},[222,480,423],{"class":232},[222,482,311],{"class":228},[222,484,486,488,491,493,496,498,500,502,504,506,508,511,513,515,517,520,522,524],{"class":224,"line":485},7,[222,487,366],{"class":228},[222,489,490],{"class":242},")(window",[222,492,256],{"class":228},[222,494,495],{"class":242},"document",[222,497,256],{"class":228},[222,499,335],{"class":228},[222,501,233],{"class":338},[222,503,335],{"class":228},[222,505,256],{"class":228},[222,507,335],{"class":228},[222,509,510],{"class":338},"https://t.trustdata.tech/t.js",[222,512,335],{"class":228},[222,514,256],{"class":228},[222,516,335],{"class":228},[222,518,519],{"class":338},"trustdata",[222,521,335],{"class":228},[222,523,423],{"class":242},[222,525,311],{"class":228},[222,527,529,532,534],{"class":224,"line":528},8,[222,530,531],{"class":228},"\u003C/",[222,533,233],{"class":232},[222,535,236],{"class":228},[204,537,538,539,541],{},"Replace ",[208,540,348],{}," with your attribution ID from the dashboard.",[199,543,545],{"id":544},"separate-script-tag","Separate script tag",[204,547,548,549,551,552,555],{},"You can load the script and call ",[208,550,339],{}," in two tags instead. The script sets ",[208,553,554],{},"window.trustdata"," when it loads, so the second tag runs once the first has finished:",[213,557,559],{"className":215,"code":558,"language":217,"meta":218,"style":218},"\u003Cscript src=\"https://t.trustdata.tech/t.js\">\u003C/script>\n\u003Cscript>\n  trustdata.init('ATTRIBUTION_ID');\n\u003C/script>\n",[208,560,561,586,594,615],{"__ignoreMap":218},[222,562,563,565,567,570,572,575,577,579,582,584],{"class":224,"line":225},[222,564,229],{"class":228},[222,566,233],{"class":232},[222,568,569],{"class":246}," src",[222,571,294],{"class":228},[222,573,574],{"class":228},"\"",[222,576,510],{"class":338},[222,578,574],{"class":228},[222,580,581],{"class":228},">\u003C/",[222,583,233],{"class":232},[222,585,236],{"class":228},[222,587,588,590,592],{"class":224,"line":239},[222,589,229],{"class":228},[222,591,233],{"class":232},[222,593,236],{"class":228},[222,595,596,599,601,603,605,607,609,611,613],{"class":224,"line":280},[222,597,598],{"class":242},"  trustdata",[222,600,325],{"class":228},[222,602,339],{"class":328},[222,604,243],{"class":242},[222,606,335],{"class":228},[222,608,348],{"class":338},[222,610,335],{"class":228},[222,612,423],{"class":242},[222,614,311],{"class":228},[222,616,617,619,621],{"class":224,"line":314},[222,618,531],{"class":228},[222,620,233],{"class":232},[222,622,236],{"class":228},[204,624,625,626,629,630,632,633,637],{},"If your attribution ID serves tracking from your own domain, the installation code in TrustData also adds ",[208,627,628],{},"apiHost"," to the ",[208,631,339],{}," call. Copy the code from ",[634,635,636],"strong",{},"Installation code"," on the attribution ID page instead of writing it by hand.",[194,639,641],{"id":640},"configuration-options","Configuration options",[213,643,647],{"className":644,"code":645,"language":646,"meta":218,"style":218},"language-javascript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","trustdata.init('ATTRIBUTION_ID', {\n  // Send a pageview event on initialization\n  sendPageView: true,\n\n  // Initial consent state\n  consent: {\n    analytics: false,\n    advertising: false,\n    preferences: false,\n    sale_of_data: false\n  },\n\n  // Event server endpoint (default: TrustData cloud)\n  apiHost: 'https://t.trustdata.tech',\n\n  // Params added to every event (see setDefaults)\n  defaultProps: { site_type: 'com' }\n});\n","javascript",[208,648,649,670,676,689,695,700,709,721,732,744,755,761,766,772,790,795,801,827],{"__ignoreMap":218},[222,650,651,653,655,657,659,661,663,665,667],{"class":224,"line":225},[222,652,519],{"class":242},[222,654,325],{"class":228},[222,656,339],{"class":328},[222,658,243],{"class":242},[222,660,335],{"class":228},[222,662,348],{"class":338},[222,664,335],{"class":228},[222,666,256],{"class":228},[222,668,669],{"class":228}," {\n",[222,671,672],{"class":224,"line":239},[222,673,675],{"class":674},"sHwdD","  // Send a pageview event on initialization\n",[222,677,678,681,683,686],{"class":224,"line":280},[222,679,680],{"class":232},"  sendPageView",[222,682,359],{"class":228},[222,684,685],{"class":362}," true",[222,687,688],{"class":228},",\n",[222,690,691],{"class":224,"line":314},[222,692,694],{"emptyLinePlaceholder":693},true,"\n",[222,696,697],{"class":224,"line":374},[222,698,699],{"class":674},"  // Initial consent state\n",[222,701,702,705,707],{"class":224,"line":428},[222,703,704],{"class":232},"  consent",[222,706,359],{"class":228},[222,708,669],{"class":228},[222,710,711,714,716,719],{"class":224,"line":485},[222,712,713],{"class":232},"    analytics",[222,715,359],{"class":228},[222,717,718],{"class":362}," false",[222,720,688],{"class":228},[222,722,723,726,728,730],{"class":224,"line":528},[222,724,725],{"class":232},"    advertising",[222,727,359],{"class":228},[222,729,718],{"class":362},[222,731,688],{"class":228},[222,733,735,738,740,742],{"class":224,"line":734},9,[222,736,737],{"class":232},"    preferences",[222,739,359],{"class":228},[222,741,718],{"class":362},[222,743,688],{"class":228},[222,745,747,750,752],{"class":224,"line":746},10,[222,748,749],{"class":232},"    sale_of_data",[222,751,359],{"class":228},[222,753,754],{"class":362}," false\n",[222,756,758],{"class":224,"line":757},11,[222,759,760],{"class":228},"  },\n",[222,762,764],{"class":224,"line":763},12,[222,765,694],{"emptyLinePlaceholder":693},[222,767,769],{"class":224,"line":768},13,[222,770,771],{"class":674},"  // Event server endpoint (default: TrustData cloud)\n",[222,773,775,778,780,783,786,788],{"class":224,"line":774},14,[222,776,777],{"class":232},"  apiHost",[222,779,359],{"class":228},[222,781,782],{"class":228}," '",[222,784,785],{"class":338},"https://t.trustdata.tech",[222,787,335],{"class":228},[222,789,688],{"class":228},[222,791,793],{"class":224,"line":792},15,[222,794,694],{"emptyLinePlaceholder":693},[222,796,798],{"class":224,"line":797},16,[222,799,800],{"class":674},"  // Params added to every event (see setDefaults)\n",[222,802,804,807,809,812,815,817,819,822,824],{"class":224,"line":803},17,[222,805,806],{"class":232},"  defaultProps",[222,808,359],{"class":228},[222,810,811],{"class":228}," {",[222,813,814],{"class":232}," site_type",[222,816,359],{"class":228},[222,818,782],{"class":228},[222,820,821],{"class":338},"com",[222,823,335],{"class":228},[222,825,826],{"class":228}," }\n",[222,828,830,832,834],{"class":224,"line":829},18,[222,831,366],{"class":228},[222,833,423],{"class":242},[222,835,311],{"class":228},[199,837,839],{"id":838},"configuration-reference","Configuration reference",[841,842,843,862],"table",{},[844,845,846],"thead",{},[847,848,849,853,856,859],"tr",{},[850,851,852],"th",{},"Option",[850,854,855],{},"Type",[850,857,858],{},"Default",[850,860,861],{},"Description",[863,864,865,882,901,917,936],"tbody",{},[847,866,867,872,875,879],{},[868,869,870],"td",{},[208,871,356],{},[868,873,874],{},"boolean",[868,876,877],{},[208,878,363],{},[868,880,881],{},"Send pageview on init",[847,883,884,889,892,898],{},[868,885,886],{},[208,887,888],{},"consent",[868,890,891],{},"object",[868,893,894,895],{},"all ",[208,896,897],{},"false",[868,899,900],{},"Initial consent state (4 levels)",[847,902,903,907,910,914],{},[868,904,905],{},[208,906,628],{},[868,908,909],{},"string",[868,911,912],{},[208,913,785],{},[868,915,916],{},"Event server endpoint",[847,918,919,924,926,931],{},[868,920,921],{},[208,922,923],{},"apiPath",[868,925,909],{},[868,927,928],{},[208,929,930],{},"/api/events",[868,932,933,934],{},"Path the SDK posts events to on ",[208,935,628],{},[847,937,938,943,945,948],{},[868,939,940],{},[208,941,942],{},"defaultProps",[868,944,891],{},[868,946,947],{},"none",[868,949,950,951],{},"Params added to every event. Same as calling ",[952,953,955],"a",{"href":954},"#trustdatasetdefaultsprops",[208,956,957],{},"setDefaults",[959,960,963,964,967,968,971,972,975,976,979,980,983],"callout",{"color":961,"icon":962},"info","i-lucide-info","To stop payment gateways, SSO providers, or your own domains from showing up as referrers, add them in the dashboard: ",[634,965,966],{},"Settings"," → ",[634,969,970],{},"Attribution IDs"," → select the attribution ID → ",[634,973,974],{},"Filtering"," tab → ",[634,977,978],{},"Referral exclusion",". The older ",[208,981,982],{},"ignoreDomains"," SDK option has no effect.",[194,985,987],{"id":986},"api-methods","API methods",[204,989,990],{},"Every method can be called in two ways:",[213,992,994],{"className":644,"code":993,"language":646,"meta":218,"style":218},"// Command-queue form: works at any time, even before t.js has loaded\ntrustdata.push(['event', 'button_click', { button_id: 'signup' }]);\n\n// Direct form: works once t.js has loaded\ntrustdata.event('button_click', { button_id: 'signup' });\n",[208,995,996,1001,1050,1054,1059],{"__ignoreMap":218},[222,997,998],{"class":224,"line":225},[222,999,1000],{"class":674},"// Command-queue form: works at any time, even before t.js has loaded\n",[222,1002,1003,1005,1007,1009,1011,1013,1016,1018,1020,1022,1025,1027,1029,1031,1034,1036,1038,1041,1043,1046,1048],{"class":224,"line":239},[222,1004,519],{"class":242},[222,1006,325],{"class":228},[222,1008,329],{"class":328},[222,1010,332],{"class":242},[222,1012,335],{"class":228},[222,1014,1015],{"class":338},"event",[222,1017,335],{"class":228},[222,1019,256],{"class":228},[222,1021,782],{"class":228},[222,1023,1024],{"class":338},"button_click",[222,1026,335],{"class":228},[222,1028,256],{"class":228},[222,1030,811],{"class":228},[222,1032,1033],{"class":232}," button_id",[222,1035,359],{"class":228},[222,1037,782],{"class":228},[222,1039,1040],{"class":338},"signup",[222,1042,335],{"class":228},[222,1044,1045],{"class":228}," }",[222,1047,369],{"class":242},[222,1049,311],{"class":228},[222,1051,1052],{"class":224,"line":280},[222,1053,694],{"emptyLinePlaceholder":693},[222,1055,1056],{"class":224,"line":314},[222,1057,1058],{"class":674},"// Direct form: works once t.js has loaded\n",[222,1060,1061,1063,1065,1067,1069,1071,1073,1075,1077,1079,1081,1083,1085,1087,1089,1091,1093],{"class":224,"line":374},[222,1062,519],{"class":242},[222,1064,325],{"class":228},[222,1066,1015],{"class":328},[222,1068,243],{"class":242},[222,1070,335],{"class":228},[222,1072,1024],{"class":338},[222,1074,335],{"class":228},[222,1076,256],{"class":228},[222,1078,811],{"class":228},[222,1080,1033],{"class":232},[222,1082,359],{"class":228},[222,1084,782],{"class":228},[222,1086,1040],{"class":338},[222,1088,335],{"class":228},[222,1090,1045],{"class":228},[222,1092,423],{"class":242},[222,1094,311],{"class":228},[204,1096,1097,1098,1100],{},"Use the ",[208,1099,329],{}," form for code that can run before the SDK loads, such as an inline script on an order confirmation page. Calls queued before load run as soon as the SDK is ready.",[199,1102,1104],{"id":1103},"trustdataeventname-props","trustdata.event(name, props)",[204,1106,1107],{},"Track custom events:",[213,1109,1111],{"className":644,"code":1110,"language":646,"meta":218,"style":218},"trustdata.event('button_click', {\n  button_id: 'signup',\n  page: '/pricing'\n});\n\ntrustdata.event('add_to_cart', {\n  id: 'SKU123',\n  value: 49.99\n});\n",[208,1112,1113,1133,1148,1163,1171,1175,1196,1212,1222],{"__ignoreMap":218},[222,1114,1115,1117,1119,1121,1123,1125,1127,1129,1131],{"class":224,"line":225},[222,1116,519],{"class":242},[222,1118,325],{"class":228},[222,1120,1015],{"class":328},[222,1122,243],{"class":242},[222,1124,335],{"class":228},[222,1126,1024],{"class":338},[222,1128,335],{"class":228},[222,1130,256],{"class":228},[222,1132,669],{"class":228},[222,1134,1135,1138,1140,1142,1144,1146],{"class":224,"line":239},[222,1136,1137],{"class":232},"  button_id",[222,1139,359],{"class":228},[222,1141,782],{"class":228},[222,1143,1040],{"class":338},[222,1145,335],{"class":228},[222,1147,688],{"class":228},[222,1149,1150,1153,1155,1157,1160],{"class":224,"line":280},[222,1151,1152],{"class":232},"  page",[222,1154,359],{"class":228},[222,1156,782],{"class":228},[222,1158,1159],{"class":338},"/pricing",[222,1161,1162],{"class":228},"'\n",[222,1164,1165,1167,1169],{"class":224,"line":314},[222,1166,366],{"class":228},[222,1168,423],{"class":242},[222,1170,311],{"class":228},[222,1172,1173],{"class":224,"line":374},[222,1174,694],{"emptyLinePlaceholder":693},[222,1176,1177,1179,1181,1183,1185,1187,1190,1192,1194],{"class":224,"line":428},[222,1178,519],{"class":242},[222,1180,325],{"class":228},[222,1182,1015],{"class":328},[222,1184,243],{"class":242},[222,1186,335],{"class":228},[222,1188,1189],{"class":338},"add_to_cart",[222,1191,335],{"class":228},[222,1193,256],{"class":228},[222,1195,669],{"class":228},[222,1197,1198,1201,1203,1205,1208,1210],{"class":224,"line":485},[222,1199,1200],{"class":232},"  id",[222,1202,359],{"class":228},[222,1204,782],{"class":228},[222,1206,1207],{"class":338},"SKU123",[222,1209,335],{"class":228},[222,1211,688],{"class":228},[222,1213,1214,1217,1219],{"class":224,"line":528},[222,1215,1216],{"class":232},"  value",[222,1218,359],{"class":228},[222,1220,1221],{"class":399}," 49.99\n",[222,1223,1224,1226,1228],{"class":224,"line":734},[222,1225,366],{"class":228},[222,1227,423],{"class":242},[222,1229,311],{"class":228},[199,1231,1233],{"id":1232},"trustdatasetdefaultsprops","trustdata.setDefaults(props)",[204,1235,1236,1237,1240,1241,359],{},"Add params to every event, including the ones the SDK sends by itself such as ",[208,1238,1239],{},"page_leave"," and ",[208,1242,1243],{},"user_engagement",[213,1245,1247],{"className":644,"code":1246,"language":646,"meta":218,"style":218},"trustdata.setDefaults({ site_type: 'com', user_type: 'Visitor' });\n\n// The event's own value wins over the default\ntrustdata.event('purchase', { user_type: 'Customer' });\n",[208,1248,1249,1292,1296,1301],{"__ignoreMap":218},[222,1250,1251,1253,1255,1257,1259,1262,1264,1266,1268,1270,1272,1274,1277,1279,1281,1284,1286,1288,1290],{"class":224,"line":225},[222,1252,519],{"class":242},[222,1254,325],{"class":228},[222,1256,957],{"class":328},[222,1258,243],{"class":242},[222,1260,1261],{"class":228},"{",[222,1263,814],{"class":232},[222,1265,359],{"class":228},[222,1267,782],{"class":228},[222,1269,821],{"class":338},[222,1271,335],{"class":228},[222,1273,256],{"class":228},[222,1275,1276],{"class":232}," user_type",[222,1278,359],{"class":228},[222,1280,782],{"class":228},[222,1282,1283],{"class":338},"Visitor",[222,1285,335],{"class":228},[222,1287,1045],{"class":228},[222,1289,423],{"class":242},[222,1291,311],{"class":228},[222,1293,1294],{"class":224,"line":239},[222,1295,694],{"emptyLinePlaceholder":693},[222,1297,1298],{"class":224,"line":280},[222,1299,1300],{"class":674},"// The event's own value wins over the default\n",[222,1302,1303,1305,1307,1309,1311,1313,1316,1318,1320,1322,1324,1326,1328,1331,1333,1335,1337],{"class":224,"line":314},[222,1304,519],{"class":242},[222,1306,325],{"class":228},[222,1308,1015],{"class":328},[222,1310,243],{"class":242},[222,1312,335],{"class":228},[222,1314,1315],{"class":338},"purchase",[222,1317,335],{"class":228},[222,1319,256],{"class":228},[222,1321,811],{"class":228},[222,1323,1276],{"class":232},[222,1325,359],{"class":228},[222,1327,782],{"class":228},[222,1329,1330],{"class":338},"Customer",[222,1332,335],{"class":228},[222,1334,1045],{"class":228},[222,1336,423],{"class":242},[222,1338,311],{"class":228},[204,1340,1341,1342,1344],{},"Each call merges into the earlier defaults at the top level, and a later value replaces an earlier one. A nested object replaces the earlier object. It is not merged. The SDK reads the defaults when it builds each event, so a call after ",[208,1343,339],{}," reaches the next event.",[204,1346,1347],{},"When the same field is set in more than one place, the first of these wins:",[1349,1350,1351,1382,1388],"ol",{},[1352,1353,1354,1355,1358,1359,1358,1362,1358,1365,1358,1368,1358,1370,1358,1373,1358,1376,1240,1379,325],"li",{},"The SDK's own fields: ",[208,1356,1357],{},"event_name",", ",[208,1360,1361],{},"attribution_id",[208,1363,1364],{},"visitor_id",[208,1366,1367],{},"user_id",[208,1369,888],{},[208,1371,1372],{},"lib",[208,1374,1375],{},"lib_version",[208,1377,1378],{},"lib_modules",[208,1380,1381],{},"first_visit",[1352,1383,1384,1385,325],{},"The props you pass to ",[208,1386,1387],{},"event()",[1352,1389,1390],{},"The defaults.",[204,1392,1393,1394,1358,1397,1358,1400,1403,1404,1407,1408,1358,1411,1414,1415,1358,1418,1358,1421,1358,1424,1358,1427,1358,1430,1433],{},"A default cannot set ",[208,1395,1396],{},"event_time",[208,1398,1399],{},"page_location",[208,1401,1402],{},"page_referrer"," or ",[208,1405,1406],{},"page_title",". It also cannot set the fields the SDK sends only with consent: ",[208,1409,1410],{},"user_data",[208,1412,1413],{},"fbp",", the device fields (",[208,1416,1417],{},"raw_user_agent",[208,1419,1420],{},"screen_resolution",[208,1422,1423],{},"viewport_size",[208,1425,1426],{},"timezone",[208,1428,1429],{},"browser_language",[208,1431,1432],{},"webdriver",") and the adblock fields.",[204,1435,1436],{},"Defaults are sent whether or not the visitor consents. Never put personal data in them.",[199,1438,1440],{"id":1439},"trustdataconsentoptions-opts","trustdata.consent(options, opts)",[204,1442,1443],{},"Update consent state:",[213,1445,1447],{"className":644,"code":1446,"language":646,"meta":218,"style":218},"// Grant all consent\ntrustdata.consent({\n  analytics: true,\n  advertising: true\n});\n\n// Revoke advertising consent\ntrustdata.consent({\n  analytics: true,\n  advertising: false\n});\n",[208,1448,1449,1454,1467,1478,1488,1496,1500,1505,1517,1527,1535],{"__ignoreMap":218},[222,1450,1451],{"class":224,"line":225},[222,1452,1453],{"class":674},"// Grant all consent\n",[222,1455,1456,1458,1460,1462,1464],{"class":224,"line":239},[222,1457,519],{"class":242},[222,1459,325],{"class":228},[222,1461,888],{"class":328},[222,1463,243],{"class":242},[222,1465,1466],{"class":228},"{\n",[222,1468,1469,1472,1474,1476],{"class":224,"line":280},[222,1470,1471],{"class":232},"  analytics",[222,1473,359],{"class":228},[222,1475,685],{"class":362},[222,1477,688],{"class":228},[222,1479,1480,1483,1485],{"class":224,"line":314},[222,1481,1482],{"class":232},"  advertising",[222,1484,359],{"class":228},[222,1486,1487],{"class":362}," true\n",[222,1489,1490,1492,1494],{"class":224,"line":374},[222,1491,366],{"class":228},[222,1493,423],{"class":242},[222,1495,311],{"class":228},[222,1497,1498],{"class":224,"line":428},[222,1499,694],{"emptyLinePlaceholder":693},[222,1501,1502],{"class":224,"line":485},[222,1503,1504],{"class":674},"// Revoke advertising consent\n",[222,1506,1507,1509,1511,1513,1515],{"class":224,"line":528},[222,1508,519],{"class":242},[222,1510,325],{"class":228},[222,1512,888],{"class":328},[222,1514,243],{"class":242},[222,1516,1466],{"class":228},[222,1518,1519,1521,1523,1525],{"class":224,"line":734},[222,1520,1471],{"class":232},[222,1522,359],{"class":228},[222,1524,685],{"class":362},[222,1526,688],{"class":228},[222,1528,1529,1531,1533],{"class":224,"line":746},[222,1530,1482],{"class":232},[222,1532,359],{"class":228},[222,1534,754],{"class":362},[222,1536,1537,1539,1541],{"class":224,"line":757},[222,1538,366],{"class":228},[222,1540,423],{"class":242},[222,1542,311],{"class":228},[204,1544,1545,1546,1549],{},"Pass ",[208,1547,1548],{},"{ interaction: true }"," as the second argument when the call comes from a real choice the visitor just made in your consent banner. Leave it out when you replay the stored consent state on page load. TrustData uses this flag to tell a genuine refusal apart from a visitor who hasn't decided yet, which drives the consent rate in the dashboard.",[213,1551,1553],{"className":644,"code":1552,"language":646,"meta":218,"style":218},"// In your CMP's \"consent changed\" callback\ntrustdata.consent({ analytics: true, advertising: false }, { interaction: true });\n",[208,1554,1555,1560],{"__ignoreMap":218},[222,1556,1557],{"class":224,"line":225},[222,1558,1559],{"class":674},"// In your CMP's \"consent changed\" callback\n",[222,1561,1562,1564,1566,1568,1570,1572,1575,1577,1579,1581,1584,1586,1588,1591,1593,1596,1598,1600,1602,1604],{"class":224,"line":239},[222,1563,519],{"class":242},[222,1565,325],{"class":228},[222,1567,888],{"class":328},[222,1569,243],{"class":242},[222,1571,1261],{"class":228},[222,1573,1574],{"class":232}," analytics",[222,1576,359],{"class":228},[222,1578,685],{"class":362},[222,1580,256],{"class":228},[222,1582,1583],{"class":232}," advertising",[222,1585,359],{"class":228},[222,1587,718],{"class":362},[222,1589,1590],{"class":228}," },",[222,1592,811],{"class":228},[222,1594,1595],{"class":232}," interaction",[222,1597,359],{"class":228},[222,1599,685],{"class":362},[222,1601,1045],{"class":228},[222,1603,423],{"class":242},[222,1605,311],{"class":228},[204,1607,1608],{},"Withdrawing analytics consent clears the stored visitor ID and user ID.",[204,1610,1611,1612,1614,1615,1618,1619,1621,1622,1624,1625,1627,1628,1240,1630,325],{},"Consent is part of the SDK state, not of an event. The SDK builds the ",[208,1613,888],{}," object on every event from the state you set with ",[208,1616,1617],{},"consent()"," or the ",[208,1620,888],{}," init option. A ",[208,1623,888],{}," value passed to ",[208,1626,1387],{}," is discarded, as are ",[208,1629,1364],{},[208,1631,1367],{},[199,1633,1635],{"id":1634},"trustdatasetuseridid","trustdata.setUserId(id)",[204,1637,1638],{},"Associate events with a known user:",[213,1640,1642],{"className":644,"code":1641,"language":646,"meta":218,"style":218},"// After user logs in\ntrustdata.setUserId('user_123');\n",[208,1643,1644,1649],{"__ignoreMap":218},[222,1645,1646],{"class":224,"line":225},[222,1647,1648],{"class":674},"// After user logs in\n",[222,1650,1651,1653,1655,1658,1660,1662,1665,1667,1669],{"class":224,"line":239},[222,1652,519],{"class":242},[222,1654,325],{"class":228},[222,1656,1657],{"class":328},"setUserId",[222,1659,243],{"class":242},[222,1661,335],{"class":228},[222,1663,1664],{"class":338},"user_123",[222,1666,335],{"class":228},[222,1668,423],{"class":242},[222,1670,311],{"class":228},[204,1672,1673],{},"The user ID persists across sessions. TrustData uses it for cross-device attribution.",[199,1675,1677],{"id":1676},"trustdatagetvisitorid","trustdata.getVisitorId()",[204,1679,1680],{},"Get the current visitor's ID:",[213,1682,1684],{"className":644,"code":1683,"language":646,"meta":218,"style":218},"const visitorId = trustdata.getVisitorId();\nconsole.log(visitorId); // \"3f2b8c1e-5d4a-4f6b-9c2d-7e8f9a0b1c2d\"\n",[208,1685,1686,1709],{"__ignoreMap":218},[222,1687,1688,1691,1694,1696,1699,1701,1704,1707],{"class":224,"line":225},[222,1689,1690],{"class":246},"const",[222,1692,1693],{"class":242}," visitorId ",[222,1695,294],{"class":228},[222,1697,1698],{"class":242}," trustdata",[222,1700,325],{"class":228},[222,1702,1703],{"class":328},"getVisitorId",[222,1705,1706],{"class":242},"()",[222,1708,311],{"class":228},[222,1710,1711,1714,1716,1719,1722,1724],{"class":224,"line":239},[222,1712,1713],{"class":242},"console",[222,1715,325],{"class":228},[222,1717,1718],{"class":328},"log",[222,1720,1721],{"class":242},"(visitorId)",[222,1723,444],{"class":228},[222,1725,1726],{"class":674}," // \"3f2b8c1e-5d4a-4f6b-9c2d-7e8f9a0b1c2d\"\n",[204,1728,1729,1730,1733],{},"The ID is a UUID. It's ",[208,1731,1732],{},"null"," until the visitor grants analytics consent.",[199,1735,1737],{"id":1736},"trustdatasetuserdata","trustdata.setUser(data)",[204,1739,1740],{},"Set customer data for enhanced conversions. The SDK attaches these fields to the events that follow to improve match rates on ad platforms.",[213,1742,1744],{"className":644,"code":1743,"language":646,"meta":218,"style":218},"trustdata.setUser({\n  email: 'user@example.com',\n  phone: '+15551234567',        // E.164 format\n  first_name: 'Jane',\n  last_name: 'Doe',\n  address: {\n    city: 'Paris',\n    postal_code: '75001',\n    country: 'FR'              // ISO 3166-1 alpha-2\n  }\n});\n",[208,1745,1746,1759,1775,1794,1810,1826,1835,1851,1867,1884,1889],{"__ignoreMap":218},[222,1747,1748,1750,1752,1755,1757],{"class":224,"line":225},[222,1749,519],{"class":242},[222,1751,325],{"class":228},[222,1753,1754],{"class":328},"setUser",[222,1756,243],{"class":242},[222,1758,1466],{"class":228},[222,1760,1761,1764,1766,1768,1771,1773],{"class":224,"line":239},[222,1762,1763],{"class":232},"  email",[222,1765,359],{"class":228},[222,1767,782],{"class":228},[222,1769,1770],{"class":338},"user@example.com",[222,1772,335],{"class":228},[222,1774,688],{"class":228},[222,1776,1777,1780,1782,1784,1787,1789,1791],{"class":224,"line":280},[222,1778,1779],{"class":232},"  phone",[222,1781,359],{"class":228},[222,1783,782],{"class":228},[222,1785,1786],{"class":338},"+15551234567",[222,1788,335],{"class":228},[222,1790,256],{"class":228},[222,1792,1793],{"class":674},"        // E.164 format\n",[222,1795,1796,1799,1801,1803,1806,1808],{"class":224,"line":314},[222,1797,1798],{"class":232},"  first_name",[222,1800,359],{"class":228},[222,1802,782],{"class":228},[222,1804,1805],{"class":338},"Jane",[222,1807,335],{"class":228},[222,1809,688],{"class":228},[222,1811,1812,1815,1817,1819,1822,1824],{"class":224,"line":374},[222,1813,1814],{"class":232},"  last_name",[222,1816,359],{"class":228},[222,1818,782],{"class":228},[222,1820,1821],{"class":338},"Doe",[222,1823,335],{"class":228},[222,1825,688],{"class":228},[222,1827,1828,1831,1833],{"class":224,"line":428},[222,1829,1830],{"class":232},"  address",[222,1832,359],{"class":228},[222,1834,669],{"class":228},[222,1836,1837,1840,1842,1844,1847,1849],{"class":224,"line":485},[222,1838,1839],{"class":232},"    city",[222,1841,359],{"class":228},[222,1843,782],{"class":228},[222,1845,1846],{"class":338},"Paris",[222,1848,335],{"class":228},[222,1850,688],{"class":228},[222,1852,1853,1856,1858,1860,1863,1865],{"class":224,"line":528},[222,1854,1855],{"class":232},"    postal_code",[222,1857,359],{"class":228},[222,1859,782],{"class":228},[222,1861,1862],{"class":338},"75001",[222,1864,335],{"class":228},[222,1866,688],{"class":228},[222,1868,1869,1872,1874,1876,1879,1881],{"class":224,"line":734},[222,1870,1871],{"class":232},"    country",[222,1873,359],{"class":228},[222,1875,782],{"class":228},[222,1877,1878],{"class":338},"FR",[222,1880,335],{"class":228},[222,1882,1883],{"class":674},"              // ISO 3166-1 alpha-2\n",[222,1885,1886],{"class":224,"line":746},[222,1887,1888],{"class":228},"  }\n",[222,1890,1891,1893,1895],{"class":224,"line":757},[222,1892,366],{"class":228},[222,1894,423],{"class":242},[222,1896,311],{"class":228},[1898,1899,1900,1913,1923],"ul",{},[1352,1901,1902,1905,1906,1240,1909,1912],{},[208,1903,1904],{},"setUser()"," is asynchronous. The SDK hashes ",[208,1907,1908],{},"email",[208,1910,1911],{},"phone"," with SHA-256 in the browser before it stores them, so the raw values never leave the page.",[1352,1914,1915,1916,1919,1920,1922],{},"The SDK only sends this data when the visitor has granted ",[634,1917,1918],{},"advertising"," consent. Without it, ",[208,1921,1410],{}," is left out of the event.",[1352,1924,1925,1928,1929,325],{},[208,1926,1927],{},"trustdata.getUserData()"," returns the stored (hashed) user data, or ",[208,1930,1732],{},[199,1932,1934],{"id":1933},"trustdataclearuser","trustdata.clearUser()",[204,1936,1937],{},"Clear stored user data (e.g., on logout):",[213,1939,1941],{"className":644,"code":1940,"language":646,"meta":218,"style":218},"trustdata.clearUser();\n",[208,1942,1943],{"__ignoreMap":218},[222,1944,1945,1947,1949,1952,1954],{"class":224,"line":225},[222,1946,519],{"class":242},[222,1948,325],{"class":228},[222,1950,1951],{"class":328},"clearUser",[222,1953,1706],{"class":242},[222,1955,311],{"class":228},[199,1957,1959],{"id":1958},"trustdatalinkidentity","trustdata.linkIdentity()",[204,1961,1962,1963,1966],{},"Links the anonymous pre-consent fingerprint (",[208,1964,1965],{},"fp_xxx",") to the new cookie-based visitor ID after a consent upgrade. This attributes touchpoints captured before consent (landing pages, ad clicks) to the eventual conversion.",[204,1968,1969,1972,1973,1976],{},[634,1970,1971],{},"The GTM template calls this automatically"," when ",[208,1974,1975],{},"analytics_storage"," is granted. Only call it manually if you manage consent outside GTM:",[213,1978,1980],{"className":644,"code":1979,"language":646,"meta":218,"style":218},"// After the user grants analytics consent\ntrustdata.consent({ analytics: true });\ntrustdata.linkIdentity(); // sends identity_link event, no-op if no ID transition\n",[208,1981,1982,1987,2011],{"__ignoreMap":218},[222,1983,1984],{"class":224,"line":225},[222,1985,1986],{"class":674},"// After the user grants analytics consent\n",[222,1988,1989,1991,1993,1995,1997,1999,2001,2003,2005,2007,2009],{"class":224,"line":239},[222,1990,519],{"class":242},[222,1992,325],{"class":228},[222,1994,888],{"class":328},[222,1996,243],{"class":242},[222,1998,1261],{"class":228},[222,2000,1574],{"class":232},[222,2002,359],{"class":228},[222,2004,685],{"class":362},[222,2006,1045],{"class":228},[222,2008,423],{"class":242},[222,2010,311],{"class":228},[222,2012,2013,2015,2017,2020,2022,2024],{"class":224,"line":280},[222,2014,519],{"class":242},[222,2016,325],{"class":228},[222,2018,2019],{"class":328},"linkIdentity",[222,2021,1706],{"class":242},[222,2023,444],{"class":228},[222,2025,2026],{"class":674}," // sends identity_link event, no-op if no ID transition\n",[199,2028,2030],{"id":2029},"trustdatagetadblockdata-and-trustdatadetectadblock","trustdata.getAdblockData() and trustdata.detectAdblock()",[204,2032,2033,2036,2037,2039,2040,2043],{},[208,2034,2035],{},"getAdblockData()"," returns the latest adblock detection result, or ",[208,2038,1732],{},". ",[208,2041,2042],{},"detectAdblock()"," runs detection again and returns a promise. Both need analytics consent: without it, the SDK doesn't probe ad endpoints.",[213,2045,2047],{"className":644,"code":2046,"language":646,"meta":218,"style":218},"await trustdata.detectAdblock();\nconsole.log(trustdata.getAdblockData());\n",[208,2048,2049,2066],{"__ignoreMap":218},[222,2050,2051,2055,2057,2059,2062,2064],{"class":224,"line":225},[222,2052,2054],{"class":2053},"s7zQu","await",[222,2056,1698],{"class":242},[222,2058,325],{"class":228},[222,2060,2061],{"class":328},"detectAdblock",[222,2063,1706],{"class":242},[222,2065,311],{"class":228},[222,2067,2068,2070,2072,2074,2077,2079,2082,2085],{"class":224,"line":239},[222,2069,1713],{"class":242},[222,2071,325],{"class":228},[222,2073,1718],{"class":328},[222,2075,2076],{"class":242},"(trustdata",[222,2078,325],{"class":228},[222,2080,2081],{"class":328},"getAdblockData",[222,2083,2084],{"class":242},"())",[222,2086,311],{"class":228},[199,2088,2090],{"id":2089},"trustdatadebugenabled","trustdata.debug(enabled)",[204,2092,2093],{},"Enable or disable debug logging:",[213,2095,2097],{"className":644,"code":2096,"language":646,"meta":218,"style":218},"trustdata.debug(true);  // Enable debug mode\ntrustdata.debug(false); // Disable debug mode\n",[208,2098,2099,2119],{"__ignoreMap":218},[222,2100,2101,2103,2105,2108,2110,2112,2114,2116],{"class":224,"line":225},[222,2102,519],{"class":242},[222,2104,325],{"class":228},[222,2106,2107],{"class":328},"debug",[222,2109,243],{"class":242},[222,2111,363],{"class":362},[222,2113,423],{"class":242},[222,2115,444],{"class":228},[222,2117,2118],{"class":674},"  // Enable debug mode\n",[222,2120,2121,2123,2125,2127,2129,2131,2133,2135],{"class":224,"line":239},[222,2122,519],{"class":242},[222,2124,325],{"class":228},[222,2126,2107],{"class":328},[222,2128,243],{"class":242},[222,2130,897],{"class":362},[222,2132,423],{"class":242},[222,2134,444],{"class":228},[222,2136,2137],{"class":674}," // Disable debug mode\n",[204,2139,2140],{},"With debug on, the SDK writes lines like these to the browser console:",[213,2142,2147],{"className":2143,"code":2145,"language":2146},[2144],"language-text","[TrustData] Initialized: ATTRIBUTION_ID\n[TrustData] Sending: page_view {event_name: \"page_view\", ...}\n[TrustData] Consent updated: {analytics: true, advertising: false, ...}\n","text",[208,2148,2145],{"__ignoreMap":218},[204,2150,2151,2152,2155,2156,2158,2159,325],{},"The ",[208,2153,2154],{},"Sending"," line shows the whole payload. It replaces ",[208,2157,1410],{}," with ",[208,2160,2161],{},"[redacted]",[194,2163,2165],{"id":2164},"identity-and-storage","Identity and storage",[204,2167,2168,2169,2172],{},"The SDK keeps a stable visitor identity so TrustData can link touchpoints to later conversions. The SDK writes the cookie and the ",[208,2170,2171],{},"localStorage"," keys below only after the visitor grants analytics consent.",[841,2174,2175,2191],{},[844,2176,2177],{},[847,2178,2179,2182,2185,2188],{},[850,2180,2181],{},"Key",[850,2183,2184],{},"Where",[850,2186,2187],{},"Lifetime",[850,2189,2190],{},"Purpose",[863,2192,2193,2211,2230],{},[847,2194,2195,2200,2205,2208],{},[868,2196,2197],{},[208,2198,2199],{},"_trdt_vid",[868,2201,2202,2203],{},"First-party cookie + ",[208,2204,2171],{},[868,2206,2207],{},"365 days",[868,2209,2210],{},"Visitor ID",[847,2212,2213,2218,2222,2225],{},[868,2214,2215],{},[208,2216,2217],{},"_trdt_uid",[868,2219,2220],{},[208,2221,2171],{},[868,2223,2224],{},"Until cleared",[868,2226,2227,2228],{},"User ID set via ",[208,2229,1657],{},[847,2231,2232,2237,2241,2244],{},[868,2233,2234],{},[208,2235,2236],{},"_trdt_adblock",[868,2238,2239],{},[208,2240,2171],{},[868,2242,2243],{},"24 hours",[868,2245,2246],{},"Cached adblock detection result",[204,2248,2249,2250,2253],{},"The SDK also uses three ",[208,2251,2252],{},"sessionStorage"," keys. They hold no identifier and clear when the tab closes.",[841,2255,2256,2264],{},[844,2257,2258],{},[847,2259,2260,2262],{},[850,2261,2181],{},[850,2263,2190],{},[863,2265,2266,2276,2290],{},[847,2267,2268,2273],{},[868,2269,2270],{},[208,2271,2272],{},"trdt_sdkcfg_v2",[868,2274,2275],{},"Copy of the settings the SDK fetched for the attribution ID, so later pages in the tab skip the request. The SDK writes it without consent",[847,2277,2278,2283],{},[868,2279,2280],{},[208,2281,2282],{},"_trdt_tag_sampled",[868,2284,2285,1403,2287,2289],{},[208,2286,441],{},[208,2288,400],{},": whether this tab was picked for tag monitoring. Written only when tag monitoring is on",[847,2291,2292,2297],{},[868,2293,2294],{},[208,2295,2296],{},"trdt_replay",[868,2298,2299,1403,2301,2303],{},[208,2300,441],{},[208,2302,400],{},": whether this tab was picked for session replay. Written only when session replay is on",[1898,2305,2306,2323,2344],{},[1352,2307,2308,2311,2312,2315,2316,2319,2320,2322],{},[634,2309,2310],{},"Consent gating."," Before analytics consent, the SDK stores nothing. It uses a short-lived ",[208,2313,2314],{},"fp_"," fingerprint so anonymous visits still count, then ",[208,2317,2318],{},"linkIdentity()"," links that fingerprint to the new ",[208,2321,2199],{}," once the visitor grants consent.",[1352,2324,2325,2328,2329,2332,2333,1358,2336,2339,2340,2343],{},[634,2326,2327],{},"Cross-subdomain."," On a multi-level domain the SDK sets the cookie on the registrable domain (for example ",[208,2330,2331],{},"Domain=.example.com","), so ",[208,2334,2335],{},"www",[208,2337,2338],{},"shop",", and other subdomains share one identity. On ",[208,2341,2342],{},"localhost"," or raw IPs the SDK omits the domain attribute.",[1352,2345,2346,2349,2350,2353,2354,2357,2358,2360,2361,325],{},[634,2347,2348],{},"Server cookie."," When an attribution ID serves tracking from its own domain (a CNAME tracking domain or a reverse proxy), the event server also sets an ",[208,2351,2352],{},"HttpOnly"," ",[208,2355,2356],{},"_trdt_vid_s"," cookie, and only with analytics consent. Scripts can't write it, so Safari's 7-day cap on script-set cookies doesn't apply, and it takes priority over ",[208,2359,2199],{}," when both exist. With a CNAME domain Safari still caps the server cookie to 7 days. A reverse proxy avoids that cap. The server never sets it on the default tracking domain. See ",[952,2362,78],{"href":79},[194,2364,2366],{"id":2365},"single-page-applications-spa","Single page applications (SPA)",[204,2368,2369],{},"For SPAs, track pageviews on route changes:",[213,2371,2373],{"className":644,"code":2372,"language":646,"meta":218,"style":218},"// React Router example\nimport { useLocation } from 'react-router-dom';\n\nfunction App() {\n  const location = useLocation();\n\n  useEffect(() => {\n    trustdata.event('page_view', {\n      path: location.pathname\n    });\n  }, [location]);\n\n  return \u003CRoutes>...\u003C/Routes>;\n}\n",[208,2374,2375,2380,2404,2408,2419,2436,2440,2454,2476,2490,2499,2514,2518,2543],{"__ignoreMap":218},[222,2376,2377],{"class":224,"line":225},[222,2378,2379],{"class":674},"// React Router example\n",[222,2381,2382,2385,2387,2390,2392,2395,2397,2400,2402],{"class":224,"line":239},[222,2383,2384],{"class":2053},"import",[222,2386,811],{"class":228},[222,2388,2389],{"class":242}," useLocation",[222,2391,1045],{"class":228},[222,2393,2394],{"class":2053}," from",[222,2396,782],{"class":228},[222,2398,2399],{"class":338},"react-router-dom",[222,2401,335],{"class":228},[222,2403,311],{"class":228},[222,2405,2406],{"class":224,"line":280},[222,2407,694],{"emptyLinePlaceholder":693},[222,2409,2410,2412,2415,2417],{"class":224,"line":314},[222,2411,247],{"class":246},[222,2413,2414],{"class":328}," App",[222,2416,1706],{"class":228},[222,2418,669],{"class":228},[222,2420,2421,2424,2427,2430,2432,2434],{"class":224,"line":374},[222,2422,2423],{"class":246},"  const",[222,2425,2426],{"class":242}," location",[222,2428,2429],{"class":228}," =",[222,2431,2389],{"class":328},[222,2433,1706],{"class":232},[222,2435,311],{"class":228},[222,2437,2438],{"class":224,"line":428},[222,2439,694],{"emptyLinePlaceholder":693},[222,2441,2442,2445,2447,2449,2452],{"class":224,"line":485},[222,2443,2444],{"class":328},"  useEffect",[222,2446,243],{"class":232},[222,2448,1706],{"class":228},[222,2450,2451],{"class":246}," =>",[222,2453,669],{"class":228},[222,2455,2456,2459,2461,2463,2465,2467,2470,2472,2474],{"class":224,"line":528},[222,2457,2458],{"class":242},"    trustdata",[222,2460,325],{"class":228},[222,2462,1015],{"class":328},[222,2464,243],{"class":232},[222,2466,335],{"class":228},[222,2468,2469],{"class":338},"page_view",[222,2471,335],{"class":228},[222,2473,256],{"class":228},[222,2475,669],{"class":228},[222,2477,2478,2481,2483,2485,2487],{"class":224,"line":734},[222,2479,2480],{"class":232},"      path",[222,2482,359],{"class":228},[222,2484,2426],{"class":242},[222,2486,325],{"class":228},[222,2488,2489],{"class":242},"pathname\n",[222,2491,2492,2495,2497],{"class":224,"line":746},[222,2493,2494],{"class":228},"    }",[222,2496,423],{"class":232},[222,2498,311],{"class":228},[222,2500,2501,2504,2507,2510,2512],{"class":224,"line":757},[222,2502,2503],{"class":228},"  },",[222,2505,2506],{"class":232}," [",[222,2508,2509],{"class":242},"location",[222,2511,369],{"class":232},[222,2513,311],{"class":228},[222,2515,2516],{"class":224,"line":763},[222,2517,694],{"emptyLinePlaceholder":693},[222,2519,2520,2523,2526,2530,2533,2536,2538,2540],{"class":224,"line":768},[222,2521,2522],{"class":2053},"  return",[222,2524,2525],{"class":228}," \u003C",[222,2527,2529],{"class":2528},"sBMFI","Routes",[222,2531,2532],{"class":228},">",[222,2534,2535],{"class":242},"...",[222,2537,531],{"class":228},[222,2539,2529],{"class":2528},[222,2541,2542],{"class":228},">;\n",[222,2544,2545],{"class":224,"line":774},[222,2546,2547],{"class":228},"}\n",[213,2549,2551],{"className":644,"code":2550,"language":646,"meta":218,"style":218},"// Vue Router example\nrouter.afterEach((to) => {\n  trustdata.event('page_view', {\n    path: to.path\n  });\n});\n",[208,2552,2553,2558,2581,2601,2616,2625],{"__ignoreMap":218},[222,2554,2555],{"class":224,"line":225},[222,2556,2557],{"class":674},"// Vue Router example\n",[222,2559,2560,2563,2565,2568,2570,2572,2575,2577,2579],{"class":224,"line":239},[222,2561,2562],{"class":242},"router",[222,2564,325],{"class":228},[222,2566,2567],{"class":328},"afterEach",[222,2569,243],{"class":242},[222,2571,243],{"class":228},[222,2573,2574],{"class":252},"to",[222,2576,423],{"class":228},[222,2578,2451],{"class":246},[222,2580,669],{"class":228},[222,2582,2583,2585,2587,2589,2591,2593,2595,2597,2599],{"class":224,"line":280},[222,2584,598],{"class":242},[222,2586,325],{"class":228},[222,2588,1015],{"class":328},[222,2590,243],{"class":232},[222,2592,335],{"class":228},[222,2594,2469],{"class":338},[222,2596,335],{"class":228},[222,2598,256],{"class":228},[222,2600,669],{"class":228},[222,2602,2603,2606,2608,2611,2613],{"class":224,"line":314},[222,2604,2605],{"class":232},"    path",[222,2607,359],{"class":228},[222,2609,2610],{"class":242}," to",[222,2612,325],{"class":228},[222,2614,2615],{"class":242},"path\n",[222,2617,2618,2621,2623],{"class":224,"line":374},[222,2619,2620],{"class":228},"  }",[222,2622,423],{"class":232},[222,2624,311],{"class":228},[222,2626,2627,2629,2631],{"class":224,"line":428},[222,2628,366],{"class":228},[222,2630,423],{"class":242},[222,2632,311],{"class":228},[194,2634,2636],{"id":2635},"consent-management","Consent management",[204,2638,2639],{},"Integrate with your consent management platform:",[213,2641,2643],{"className":644,"code":2642,"language":646,"meta":218,"style":218},"// Initialize without automatic page_view\ntrustdata.init('ATTRIBUTION_ID', {\n  sendPageView: false,\n  consent: {\n    analytics: false,\n    advertising: false\n  }\n});\n\n// After user grants consent in your banner\nfunction onConsentGranted() {\n  trustdata.consent({\n    analytics: true,\n    advertising: true\n  }, { interaction: true });\n  trustdata.linkIdentity(); // links pre-consent fingerprint to new cookie ID\n  trustdata.event('page_view');\n}\n\n// If user only grants analytics consent\nfunction onAnalyticsOnlyConsent() {\n  trustdata.consent({\n    analytics: true,\n    advertising: false\n  }, { interaction: true });\n  trustdata.linkIdentity();\n  trustdata.event('page_view');\n}\n",[208,2644,2645,2650,2670,2680,2688,2698,2706,2710,2718,2722,2727,2738,2750,2760,2768,2786,2801,2821,2825,2830,2836,2848,2861,2872,2881,2900,2913,2934],{"__ignoreMap":218},[222,2646,2647],{"class":224,"line":225},[222,2648,2649],{"class":674},"// Initialize without automatic page_view\n",[222,2651,2652,2654,2656,2658,2660,2662,2664,2666,2668],{"class":224,"line":239},[222,2653,519],{"class":242},[222,2655,325],{"class":228},[222,2657,339],{"class":328},[222,2659,243],{"class":242},[222,2661,335],{"class":228},[222,2663,348],{"class":338},[222,2665,335],{"class":228},[222,2667,256],{"class":228},[222,2669,669],{"class":228},[222,2671,2672,2674,2676,2678],{"class":224,"line":280},[222,2673,680],{"class":232},[222,2675,359],{"class":228},[222,2677,718],{"class":362},[222,2679,688],{"class":228},[222,2681,2682,2684,2686],{"class":224,"line":314},[222,2683,704],{"class":232},[222,2685,359],{"class":228},[222,2687,669],{"class":228},[222,2689,2690,2692,2694,2696],{"class":224,"line":374},[222,2691,713],{"class":232},[222,2693,359],{"class":228},[222,2695,718],{"class":362},[222,2697,688],{"class":228},[222,2699,2700,2702,2704],{"class":224,"line":428},[222,2701,725],{"class":232},[222,2703,359],{"class":228},[222,2705,754],{"class":362},[222,2707,2708],{"class":224,"line":485},[222,2709,1888],{"class":228},[222,2711,2712,2714,2716],{"class":224,"line":528},[222,2713,366],{"class":228},[222,2715,423],{"class":242},[222,2717,311],{"class":228},[222,2719,2720],{"class":224,"line":734},[222,2721,694],{"emptyLinePlaceholder":693},[222,2723,2724],{"class":224,"line":746},[222,2725,2726],{"class":674},"// After user grants consent in your banner\n",[222,2728,2729,2731,2734,2736],{"class":224,"line":757},[222,2730,247],{"class":246},[222,2732,2733],{"class":328}," onConsentGranted",[222,2735,1706],{"class":228},[222,2737,669],{"class":228},[222,2739,2740,2742,2744,2746,2748],{"class":224,"line":763},[222,2741,598],{"class":242},[222,2743,325],{"class":228},[222,2745,888],{"class":328},[222,2747,243],{"class":232},[222,2749,1466],{"class":228},[222,2751,2752,2754,2756,2758],{"class":224,"line":768},[222,2753,713],{"class":232},[222,2755,359],{"class":228},[222,2757,685],{"class":362},[222,2759,688],{"class":228},[222,2761,2762,2764,2766],{"class":224,"line":774},[222,2763,725],{"class":232},[222,2765,359],{"class":228},[222,2767,1487],{"class":362},[222,2769,2770,2772,2774,2776,2778,2780,2782,2784],{"class":224,"line":792},[222,2771,2503],{"class":228},[222,2773,811],{"class":228},[222,2775,1595],{"class":232},[222,2777,359],{"class":228},[222,2779,685],{"class":362},[222,2781,1045],{"class":228},[222,2783,423],{"class":232},[222,2785,311],{"class":228},[222,2787,2788,2790,2792,2794,2796,2798],{"class":224,"line":797},[222,2789,598],{"class":242},[222,2791,325],{"class":228},[222,2793,2019],{"class":328},[222,2795,1706],{"class":232},[222,2797,444],{"class":228},[222,2799,2800],{"class":674}," // links pre-consent fingerprint to new cookie ID\n",[222,2802,2803,2805,2807,2809,2811,2813,2815,2817,2819],{"class":224,"line":803},[222,2804,598],{"class":242},[222,2806,325],{"class":228},[222,2808,1015],{"class":328},[222,2810,243],{"class":232},[222,2812,335],{"class":228},[222,2814,2469],{"class":338},[222,2816,335],{"class":228},[222,2818,423],{"class":232},[222,2820,311],{"class":228},[222,2822,2823],{"class":224,"line":829},[222,2824,2547],{"class":228},[222,2826,2828],{"class":224,"line":2827},19,[222,2829,694],{"emptyLinePlaceholder":693},[222,2831,2833],{"class":224,"line":2832},20,[222,2834,2835],{"class":674},"// If user only grants analytics consent\n",[222,2837,2839,2841,2844,2846],{"class":224,"line":2838},21,[222,2840,247],{"class":246},[222,2842,2843],{"class":328}," onAnalyticsOnlyConsent",[222,2845,1706],{"class":228},[222,2847,669],{"class":228},[222,2849,2851,2853,2855,2857,2859],{"class":224,"line":2850},22,[222,2852,598],{"class":242},[222,2854,325],{"class":228},[222,2856,888],{"class":328},[222,2858,243],{"class":232},[222,2860,1466],{"class":228},[222,2862,2864,2866,2868,2870],{"class":224,"line":2863},23,[222,2865,713],{"class":232},[222,2867,359],{"class":228},[222,2869,685],{"class":362},[222,2871,688],{"class":228},[222,2873,2875,2877,2879],{"class":224,"line":2874},24,[222,2876,725],{"class":232},[222,2878,359],{"class":228},[222,2880,754],{"class":362},[222,2882,2884,2886,2888,2890,2892,2894,2896,2898],{"class":224,"line":2883},25,[222,2885,2503],{"class":228},[222,2887,811],{"class":228},[222,2889,1595],{"class":232},[222,2891,359],{"class":228},[222,2893,685],{"class":362},[222,2895,1045],{"class":228},[222,2897,423],{"class":232},[222,2899,311],{"class":228},[222,2901,2903,2905,2907,2909,2911],{"class":224,"line":2902},26,[222,2904,598],{"class":242},[222,2906,325],{"class":228},[222,2908,2019],{"class":328},[222,2910,1706],{"class":232},[222,2912,311],{"class":228},[222,2914,2916,2918,2920,2922,2924,2926,2928,2930,2932],{"class":224,"line":2915},27,[222,2917,598],{"class":242},[222,2919,325],{"class":228},[222,2921,1015],{"class":328},[222,2923,243],{"class":232},[222,2925,335],{"class":228},[222,2927,2469],{"class":338},[222,2929,335],{"class":228},[222,2931,423],{"class":232},[222,2933,311],{"class":228},[222,2935,2937],{"class":224,"line":2936},28,[222,2938,2547],{"class":228},[2940,2941,2942],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":218,"searchDepth":239,"depth":239,"links":2944},[2945,2949,2952,2964,2965,2966],{"id":196,"depth":239,"text":197,"children":2946},[2947,2948],{"id":201,"depth":280,"text":202},{"id":544,"depth":280,"text":545},{"id":640,"depth":239,"text":641,"children":2950},[2951],{"id":838,"depth":280,"text":839},{"id":986,"depth":239,"text":987,"children":2953},[2954,2955,2956,2957,2958,2959,2960,2961,2962,2963],{"id":1103,"depth":280,"text":1104},{"id":1232,"depth":280,"text":1233},{"id":1439,"depth":280,"text":1440},{"id":1634,"depth":280,"text":1635},{"id":1676,"depth":280,"text":1677},{"id":1736,"depth":280,"text":1737},{"id":1933,"depth":280,"text":1934},{"id":1958,"depth":280,"text":1959},{"id":2029,"depth":280,"text":2030},{"id":2089,"depth":280,"text":2090},{"id":2164,"depth":239,"text":2165},{"id":2365,"depth":239,"text":2366},{"id":2635,"depth":239,"text":2636},"Install and configure the TrustData JavaScript SDK.","md",null,{},{"title":62,"description":2967},"9KsPRYxEEN_Er5vzb1WPxWLbzmTZWMansnrriqK9oq0",[2974,2976],{"title":30,"path":59,"stem":60,"description":2975,"children":-1},"First-party event tracking with full visibility, including consent rates and adblock detection.",{"title":66,"path":67,"stem":68,"description":2977,"children":-1},"Install TrustData through the TrustData Web Tag template for Google Tag Manager.",1794578011579]