Already using GTM? Add GeoSwap without touching your site's code.
If your team manages scripts through Google Tag Manager, you can add GeoSwap there instead of editing your website's HTML. This is especially useful when you do not have direct access to your site's codebase or when your organization requires all scripts to go through GTM.
No code changes to your website needed
Managed through your existing GTM workflow
Works with any website that has GTM installed
Go to tagmanager.google.com and select the container for your website.
Click Tags in the left sidebar, then New. Click the tag configuration area and select Custom HTML as the tag type.
In the Custom HTML field, paste the GeoSwap script tag. Name the tag something clear like "GeoSwap".
Click the Triggering section and select the All Pages trigger (Page View event). This ensures GeoSwap loads on every page of your site.
Click Submit in the top right, then Publish. Your changes are now live.
<script src="https://cdn.geoswap.co/geoswap.js" data-account="YOUR_ACCOUNT_ID" defer></script>Replace YOUR_ACCOUNT_ID with your actual Account ID from Settings → Install in your GeoSwap dashboard.
For the best performance, you want GeoSwap to load as early as possible within GTM. You can control this with tag firing priority.
Open your GeoSwap tag in GTM.
Click Advanced Settings → Tag firing priority.
Set the priority to a high number (e.g., 100). Higher numbers fire first. This ensures GeoSwap loads before your other tags.
GTM adds a loading delay
When you load GeoSwap through GTM, there is an extra step: the browser first loads GTM, then GTM loads GeoSwap. This adds 100-300ms of delay compared to direct installation. For most features, this is fine. For time-sensitive features like geo redirects, direct installation gives a better experience.
Bottom line: If you primarily use GeoSwap for bars, popups, consents, or conditional scripts, GTM is a great choice. If you rely heavily on geo redirects or content personalization where speed matters, direct installation (adding the script to your HTML head) gives the fastest experience.
Before publishing, you can test your GeoSwap tag using GTM's built-in Preview mode:
Click Preview in the top right of your GTM workspace.
Enter your website URL and click Connect. Your site opens in a new tab with GTM's debug panel.
In the debug panel, look for your GeoSwap tag under Tags Fired. If it appears there, the script is loading correctly.
In the browser console, you should see [GeoSwap] Initialized, confirming the script is running.
After publishing your GTM container:
Open your website in a browser.
Go to Settings → Install in your GeoSwap dashboard.
Click Verify Installation. A green checkmark confirms everything is working.
GTM is convenient, but direct installation is better in some situations:
You use Geo Redirects heavily and want the fastest possible redirect speed.
You have full control over your site's HTML and don't need GTM for governance.
Your GTM container is large (many tags) and loads slowly — adding another script makes it worse.
You want to minimize the number of third-party scripts that load before GeoSwap.
See the Installation Guide for platform-specific direct installation instructions.
Create your first geo redirect or content personalization rule.