[{"data":1,"prerenderedAt":938},["ShallowReactive",2],{"navigation_docs":3,"-tracking-first-party-domain":188,"-tracking-first-party-domain-surround":933},[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":78,"body":190,"description":926,"extension":927,"links":928,"meta":929,"navigation":930,"path":79,"seo":931,"stem":80,"__hash__":932},"docs/2.tracking/6.first-party-domain.md",{"type":191,"value":192,"toc":914},"minimark",[193,210,218,274,277,282,314,321,325,382,389,393,445,448,451,454,571,575,627,631,666,669,673,690,693,713,716,733,737,754,862,872,876,885,893,902,910],[194,195,196,197,201,202,205,206,209],"p",{},"By default the SDK loads from ",[198,199,200],"code",{},"https://t.trustdata.tech"," and sends events there. A first-party tracking domain moves both to a hostname you own, such as ",[198,203,204],{},"t.yourdomain.com"," or ",[198,207,208],{},"yourdomain.com/_td",". Requests then count as first-party, and the visitor cookie TrustData sets lives on your domain.",[194,211,212,213,217],{},"TrustData offers two delivery modes. Pick one in the ",[214,215,216],"strong",{},"Delivery mode"," field.",[219,220,221,237],"table",{},[222,223,224],"thead",{},[225,226,227,231,234],"tr",{},[228,229,230],"th",{},"Mode",[228,232,233],{},"What you set up",[228,235,236],{},"Safari cookie life",[238,239,240,257],"tbody",{},[225,241,242,248,254],{},[243,244,245],"td",{},[214,246,247],{},"CNAME",[243,249,250,251],{},"One DNS record that points a subdomain at ",[198,252,253],{},"t.trustdata.tech",[243,255,256],{},"Safari caps the server cookie to 7 days",[225,258,259,264,271],{},[243,260,261],{},[214,262,263],{},"Reverse proxy (first-party, ITP-durable)",[243,265,266,267,270],{},"A rule on your own web server or CDN that forwards ",[198,268,269],{},"/_td/*"," to TrustData",[243,272,273],{},"The cookie survives Safari",[194,275,276],{},"Choose the reverse proxy when you can run one. Choose CNAME when you can only change DNS.",[278,279,281],"h2",{"id":280},"open-the-setting","Open the setting",[283,284,285,297,300,307],"ol",{},[286,287,288,289,292,293,296],"li",{},"Go to ",[214,290,291],{},"Settings"," → ",[214,294,295],{},"Attribution IDs",".",[286,298,299],{},"Select the attribution ID of the stream.",[286,301,302,303,306],{},"Open the ",[214,304,305],{},"Delivery"," tab.",[286,308,309,310,313],{},"Find the ",[214,311,312],{},"Tracking domain"," section.",[194,315,316,317,320],{},"You need the admin or edit role to change it. Select ",[214,318,319],{},"Save delivery"," after each change.",[278,322,324],{"id":323},"set-up-a-cname-domain","Set up a CNAME domain",[283,326,327,335,356,366,372],{},[286,328,329,330,332,333,296],{},"Set ",[214,331,216],{}," to ",[214,334,247],{},[286,336,337,338,341,342,344,345,348,349,352,353,296],{},"In ",[214,339,340],{},"Custom domain",", enter a subdomain such as ",[198,343,204],{},". TrustData rejects subdomains of ",[198,346,347],{},"trustdata.tech",", ",[198,350,351],{},"trustdata.io"," and ",[198,354,355],{},"trustdata.com",[286,357,358,359,361,362,365],{},"Select ",[214,360,319],{},". The ",[214,363,364],{},"Verify the domain"," section appears with a CNAME record.",[286,367,368,369,371],{},"At your DNS provider, create that record. It points your subdomain at ",[198,370,253],{},". The page also tells you to turn on the Cloudflare proxy (orange cloud) for automatic SSL.",[286,373,358,374,377,378,381],{},[214,375,376],{},"Verify DNS",". When the record resolves, the field shows a ",[214,379,380],{},"Verified"," badge.",[194,383,384,385,388],{},"Until the domain is verified, the field shows ",[214,386,387],{},"Pending"," and events keep going to the default endpoint.",[278,390,392],{"id":391},"set-up-a-reverse-proxy","Set up a reverse proxy",[283,394,395,401,414,421,428,432,440],{},[286,396,329,397,332,399,296],{},[214,398,216],{},[214,400,263],{},[286,402,337,403,405,406,409,410,413],{},[214,404,340],{},", enter the hostname visitors see, such as ",[198,407,408],{},"yourdomain.com",". The apex and ",[198,411,412],{},"www"," spellings both work, whichever you enter.",[286,415,358,416,361,418,420],{},[214,417,319],{},[214,419,364],{}," section appears with a TXT record.",[286,422,423,424,427],{},"At your DNS provider, create that record. The name is ",[198,425,426],{},"_trustdata-verify.yourdomain.com"," and the value is the token shown on the page. You do not need a CNAME record in this mode.",[286,429,358,430,296],{},[214,431,376],{},[286,433,434,435,296],{},"Add the proxy rule to your web server or CDN. See ",[436,437,439],"a",{"href":438},"#what-the-proxy-must-do","What the proxy must do",[286,441,358,442,296],{},[214,443,444],{},"Test proxy",[194,446,447],{},"If you change the domain or the delivery mode, TrustData verifies again. It issues a new TXT token, and the record you published before no longer verifies.",[278,449,439],{"id":450},"what-the-proxy-must-do",[194,452,453],{},"The collector reads these parts of each request. A proxy that satisfies all of them gives full cookie durability.",[455,456,457,493,505,513,525,554],"ul",{},[286,458,459,462,463,466,467,470,471,348,474,348,477,352,480,483,484,486,487,490,491,296],{},[214,460,461],{},"Path."," Forward everything under ",[198,464,465],{},"/_td/"," and remove the ",[198,468,469],{},"/_td"," prefix. The collector serves ",[198,472,473],{},"/t.js",[198,475,476],{},"/api/events",[198,478,479],{},"/api/config/...",[198,481,482],{},"/m/...",", and does not know ",[198,485,469],{},". For example, ",[198,488,489],{},"/_td/api/events"," must arrive as ",[198,492,476],{},[286,494,495,500,501,504],{},[214,496,497,296],{},[198,498,499],{},"X-Forwarded-Host"," Set it to your domain. The collector matches your attribution ID to your verified domain with this header. Without it, the collector falls back to the ",[198,502,503],{},"Host"," header, finds no domain, and sets no durable cookie. If the header holds a comma-separated list, the collector reads the first entry.",[286,506,507,512],{},[214,508,509,296],{},[198,510,511],{},"X-Forwarded-For"," Put the visitor's IP address first. For a verified reverse proxy domain, the collector reads the first entry that is a valid IP address. Without it, every visitor appears at the address of your proxy.",[286,514,515,520,521,524],{},[214,516,517,296],{},[198,518,519],{},"X-Forwarded-Proto"," Send ",[198,522,523],{},"https",". The collector writes the script's own origin from it.",[286,526,527,535,536,538,539,541,542,545,546,549,550,553],{},[214,528,529,352,532,296],{},[198,530,531],{},"Cookie",[198,533,534],{},"Set-Cookie"," Pass the request ",[198,537,531],{}," header and the response ",[198,540,534],{}," header through unchanged. The collector sets the ",[198,543,544],{},"_trdt_vid_s"," cookie as ",[198,547,548],{},"HttpOnly"," with ",[198,551,552],{},"Path=/_td",", and only when the visitor has granted analytics consent.",[286,555,556,561,562,565,566,568,569,296],{},[214,557,558,559,296],{},"Prefix other than ",[198,560,469],{}," If you mount the proxy on another path, send it in ",[198,563,564],{},"X-Forwarded-Prefix",", for example ",[198,567,137],{},". The collector uses it as the cookie path. Without the header it assumes ",[198,570,469],{},[572,573,574],"h3",{"id":574},"nginx",[576,577,581],"pre",{"className":578,"code":579,"language":574,"meta":580,"style":580},"language-nginx shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","location /_td/ {\n    proxy_pass         https://t.trustdata.tech/;   # the trailing slash removes /_td/\n    proxy_set_header   X-Forwarded-Host  $host;\n    proxy_set_header   X-Forwarded-For   $proxy_add_x_forwarded_for;\n    proxy_set_header   X-Forwarded-Proto https;\n    proxy_ssl_server_name on;\n}\n","",[198,582,583,591,597,603,609,615,621],{"__ignoreMap":580},[584,585,588],"span",{"class":586,"line":587},"line",1,[584,589,590],{},"location /_td/ {\n",[584,592,594],{"class":586,"line":593},2,[584,595,596],{},"    proxy_pass         https://t.trustdata.tech/;   # the trailing slash removes /_td/\n",[584,598,600],{"class":586,"line":599},3,[584,601,602],{},"    proxy_set_header   X-Forwarded-Host  $host;\n",[584,604,606],{"class":586,"line":605},4,[584,607,608],{},"    proxy_set_header   X-Forwarded-For   $proxy_add_x_forwarded_for;\n",[584,610,612],{"class":586,"line":611},5,[584,613,614],{},"    proxy_set_header   X-Forwarded-Proto https;\n",[584,616,618],{"class":586,"line":617},6,[584,619,620],{},"    proxy_ssl_server_name on;\n",[584,622,624],{"class":586,"line":623},7,[584,625,626],{},"}\n",[572,628,630],{"id":629},"caddy","Caddy",[576,632,635],{"className":633,"code":634,"language":629,"meta":580,"style":580},"language-caddy shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","handle_path /_td/* {\n    reverse_proxy https://t.trustdata.tech {\n        header_up Host {upstream_hostport}\n        header_up X-Forwarded-Host {host}\n    }\n}\n",[198,636,637,642,647,652,657,662],{"__ignoreMap":580},[584,638,639],{"class":586,"line":587},[584,640,641],{},"handle_path /_td/* {\n",[584,643,644],{"class":586,"line":593},[584,645,646],{},"    reverse_proxy https://t.trustdata.tech {\n",[584,648,649],{"class":586,"line":599},[584,650,651],{},"        header_up Host {upstream_hostport}\n",[584,653,654],{"class":586,"line":605},[584,655,656],{},"        header_up X-Forwarded-Host {host}\n",[584,658,659],{"class":586,"line":611},[584,660,661],{},"    }\n",[584,663,664],{"class":586,"line":617},[584,665,626],{},[194,667,668],{},"For other web servers and CDNs, apply the same six rules from the list above.",[278,670,672],{"id":671},"test-the-proxy","Test the proxy",[194,674,358,675,677,678,680,681,684,685,687,688,296],{},[214,676,444],{}," in the ",[214,679,364],{}," section. TrustData sends an empty request to ",[198,682,683],{},"https://yourdomain.com/_td/api/events"," and reads the collector's reply. The test confirms three things: the proxy reaches the collector, it removes the ",[198,686,469],{}," prefix, and it forwards ",[198,689,499],{},[194,691,692],{},"The test fails in these cases:",[455,694,695,698,704,710],{},[286,696,697],{},"The proxy answers with a redirect. Use a rewrite or a proxy rule, not a redirect.",[286,699,700,701,703],{},"The collector reads no host. Either the proxy drops ",[198,702,499],{},", or the domain is not verified yet.",[286,705,706,707,709],{},"The collector reads a different host than your domain. Set ",[198,708,499],{}," to your domain.",[286,711,712],{},"The domain resolves to a private, loopback or link-local address. TrustData tests public addresses only.",[194,714,715],{},"Verify the domain before you test, because an unverified domain returns no host.",[194,717,718,719,721,722,205,725,728,729,732],{},"TrustData also repeats this check once a day for every verified reverse proxy domain. The result appears under the ",[214,720,312],{}," section as ",[214,723,724],{},"Last check passed",[214,726,727],{},"Last check failed",". If the check fails twice in a row, TrustData raises a critical alert named ",[214,730,731],{},"Reverse proxy broken for"," your domain. The alert closes when a later check passes.",[278,734,736],{"id":735},"update-the-install-code","Update the install code",[194,738,739,740,743,744,747,748,332,751,753],{},"After the domain is verified, ",[214,741,742],{},"Installation code"," on the attribution ID page uses your domain. For a reverse proxy it loads the script from ",[198,745,746],{},"/_td/t.js"," and sets ",[198,749,750],{},"apiHost",[198,752,469],{},". Copy that code to your site.",[576,755,759],{"className":756,"code":757,"language":758,"meta":580,"style":580},"language-html shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003Cscript src=\"/_td/t.js\">\u003C/script>\n\u003Cscript>\n  trustdata.init('ATTRIBUTION_ID', { apiHost: '/_td' });\n\u003C/script>\n","html",[198,760,761,794,802,853],{"__ignoreMap":580},[584,762,763,767,771,775,778,781,784,786,789,791],{"class":586,"line":587},[584,764,766],{"class":765},"sMK4o","\u003C",[584,768,770],{"class":769},"swJcz","script",[584,772,774],{"class":773},"spNyl"," src",[584,776,777],{"class":765},"=",[584,779,780],{"class":765},"\"",[584,782,746],{"class":783},"sfazB",[584,785,780],{"class":765},[584,787,788],{"class":765},">\u003C/",[584,790,770],{"class":769},[584,792,793],{"class":765},">\n",[584,795,796,798,800],{"class":586,"line":593},[584,797,766],{"class":765},[584,799,770],{"class":769},[584,801,793],{"class":765},[584,803,804,808,810,814,817,820,823,825,828,831,834,837,840,842,844,847,850],{"class":586,"line":599},[584,805,807],{"class":806},"sTEyZ","  trustdata",[584,809,296],{"class":765},[584,811,813],{"class":812},"s2Zo4","init",[584,815,816],{"class":806},"(",[584,818,819],{"class":765},"'",[584,821,822],{"class":783},"ATTRIBUTION_ID",[584,824,819],{"class":765},[584,826,827],{"class":765},",",[584,829,830],{"class":765}," {",[584,832,833],{"class":769}," apiHost",[584,835,836],{"class":765},":",[584,838,839],{"class":765}," '",[584,841,469],{"class":783},[584,843,819],{"class":765},[584,845,846],{"class":765}," }",[584,848,849],{"class":806},")",[584,851,852],{"class":765},";\n",[584,854,855,858,860],{"class":586,"line":605},[584,856,857],{"class":765},"\u003C/",[584,859,770],{"class":769},[584,861,793],{"class":765},[194,863,864,865,867,868,871],{},"The paths are relative, so the apex and ",[198,866,412],{}," hostnames both work. Events that arrive on your verified domain without an ",[198,869,870],{},"attribution_id"," are assigned to the attribution ID that owns the domain.",[278,873,875],{"id":874},"troubleshooting","Troubleshooting",[194,877,878,881,882,884],{},[214,879,880],{},"Returning Safari visitors count as new after 7 days."," The proxy does not send ",[198,883,499],{},", or you use CNAME mode. Add the header or switch to the reverse proxy.",[194,886,887,881,890,892],{},[214,888,889],{},"Every visitor shows one location or one IP address.",[198,891,511],{},". Events still arrive.",[194,894,895,898,899,901],{},[214,896,897],{},"No cookie is set."," The event carried no analytics consent, or the proxy removes ",[198,900,534],{},". The collector sets the cookie only with analytics consent and only on a verified domain.",[194,903,904,907,908,296],{},[214,905,906],{},"Verify DNS fails."," The record has not propagated yet, or its value is wrong. In reverse proxy mode, check the TXT record at ",[198,909,426],{},[911,912,913],"style",{},"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 .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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}",{"title":580,"searchDepth":593,"depth":593,"links":915},[916,917,918,919,923,924,925],{"id":280,"depth":593,"text":281},{"id":323,"depth":593,"text":324},{"id":391,"depth":593,"text":392},{"id":450,"depth":593,"text":439,"children":920},[921,922],{"id":574,"depth":599,"text":574},{"id":629,"depth":599,"text":630},{"id":671,"depth":593,"text":672},{"id":735,"depth":593,"text":736},{"id":874,"depth":593,"text":875},"Serve the TrustData tracking script and event endpoint from your own domain with a CNAME record or a reverse proxy.","md",null,{},true,{"title":78,"description":926},"t88JM1_UHaP7YP_UZtZLezr29zFCoDi-clyONZnPZ6c",[934,936],{"title":74,"path":75,"stem":76,"description":935,"children":-1},"Canonical reference for event types and payload fields across the JavaScript SDK and webhook API.",{"title":30,"path":88,"stem":89,"description":937,"children":-1},"Sync ad platform data into one deduplicated dataset instead of conflicting platform reports.",1794578012691]