Use Case

GTM Data Enrichment

Push visitor location, device and browser data into the GTM data layer — available as variables in every tag and trigger.

Available via: Google Tag Manager

The challenge

Google Tag Manager is powerful for managing marketing and analytics tags — but it has no built-in access to visitor location or device data. Without an external data source, you cannot fire a tag only for visitors from a specific country, personalise ad campaigns by region, or pass location context to analytics platforms. Server-side solutions are complex; client-side alternatives require custom code that bypasses GTM entirely.

What you can achieve

  • Visitor country, region, city, currency, and language available as GTM variables
  • Browser name, OS, device brand and model exposed to all tags
  • Trigger any tag conditionally by country, city, device type, or browser
  • No code required — the GTM Custom Template handles everything

How it works

The VisitorAPI GTM Custom Template is installed directly from the Google Tag Manager Template Gallery. Once configured with your project ID, it fires on page load, fetches visitor data, and pushes it into the data layer under the visitor-api-success event. From there, you create Data Layer Variables in GTM to map each field to a usable variable.

  1. Install the VisitorAPI template from the GTM Template Gallery
  2. Configure the tag with your project ID and set the trigger
  3. Create Data Layer Variables mapping fields like visitorApiCountryCode, visitorApiCity, and visitorApiBrowser
  4. Use those variables as conditions in any other tag or trigger

Personalize user experience based on location and device

Start using VisitorAPI today and enhance your website with intelligent visitor detection.