Add a small script to your site and update your Invoca Tag settings so Invoca reads location data from a source you control instead of the browser’s default location object.
Overview
Some browser privacy changes restrict how scripts like the Invoca Tag can read the page’s URL and location information directly from the browser. The Invoca Location Proxy works around this by having your own website define the location data in a variable the Invoca Tag can read, instead of the tag reading it directly from the browser. Implementing it is a two-step process: add a script to your site, then update your Invoca Tag settings to reference the proxy instead of the browser’s default location object.
Prerequisites
Before you begin, you’ll need:
- The ability to add a small script to your website’s HTML or a JavaScript file hosted on your primary domain.
- Access to your Invoca Tag settings, since you’ll need to update any Data Source Name fields or custom code blocks that currently reference the browser’s location object directly.
Step 1: Update your website HTML
Add the following script to your page. It must load before the Invoca JavaScript loads:
This code is recommended to be placed directly in your page HTML or in a JavaScript file hosted on your primary domain, rather than a third-party or subdomain file, so the browser treats it as first-party data.
Step 2: Update your Invoca Tag settings
If your Invoca Tag references location.href or location.search in any Data Source Name field or in a custom code block, update those references to use the proxy object, Invoca.locationProxy, instead. This ensures Invoca reads location data from the source you defined in Step 1 rather than the browser’s default location object.
Common replacements:
Why this matters
Without this proxy, browser privacy restrictions can prevent the Invoca Tag from reliably reading location-based data directly from the browser, which can affect attribution accuracy. By having your own site expose location data through window.InvocaLocationProxySource before the tag loads, and pointing your tag configuration at Invoca.locationProxy instead of the browser’s native location object, you keep the same data available to Invoca in a way that’s compatible with current browser privacy behavior.
Complete both steps together. Adding the script without updating your tag settings, or updating your tag settings without adding the script, means the proxy object won’t have any data to read from.Last modified on September 30, 2026