PactDOCS

GET STARTED / 01

Install Pact

Create a site key, place the bootstrap before optional code, gate one purpose, and verify the live runtime.
01

Create a free pilot

Your pilot produces the site key used by every integration path.

Create a free pilot
02

Install before optional code

Serve pact.js from the same first-party origin and place this exact bootstrap at the start of head.

index.html
html
<script
  id="pact-bootstrap"
  data-tenant="site_live_your_key"
  data-src="/pact.js"
  data-api="/v1">
((e,r,o)=>{let a=location.search,c=(a.match(/region=(CA|TX|EU)/)||[,"CA"])[1],n=r.currentScript.dataset,t="1"==n.gpc||o.globalPrivacyControl||a.includes("gpc=1"),i=!t&&"EU"!=c&&"0"!=n.allow,l=n.src||"/pact.js",p=()=>import(l);(e.pact={ready:0,purposes:{marketing:i},gpc:!!t,region:c,on:()=>()=>0,allow:p,deny:p,openPreferences:p}).ready="TX"==c?Promise.resolve():p()})(window,document,navigator);
</script>
03

Gate optional behavior

Use a native element, the React adapter, or pactClient. They all read the same decision.

index.html
html
<pact-gate purpose="analytics">
  <analytics-dashboard></analytics-dashboard>
</pact-gate>

<pact-preferences-button>
  Privacy choices
</pact-preferences-button>
04

Verify production

Open the site in each supported regional path, exercise GPC and withdrawal, then use the Pact console to confirm the hostname and runtime version.

  • Bootstrap precedes every optional tag
  • GPC and stored rejection block before execution
  • Quiet path makes zero initial core requests
  • Purpose gates react to approval and withdrawal
  • Runtime hostname and version match
  • CLS remains 0.00 and Pact is never LCP
NEXTChoose a framework-specific install