-
Notifications
You must be signed in to change notification settings - Fork 14
Google tag gateway
With Google tag gateway for advertisers, you can serve a Google tag from your own domain using your CDN, load balancer, or web server. This first-party setup routes measurement requests through your domain, improving data accuracy and privacy compliance.
Note
If you’re setting up the Google tag gateway via a CDN or Tagging server as described in Google’s documentation, you do not need to configure anything in the plugin’s settings.
By default, Google scripts are loaded from Google’s domains, like https://www.googletagmanager.com/. Google tag gateway for advertisers lets you load Google scripts from your own domain.
This helps:
- Improve conversion measurement accuracy
- Gain deeper campaign insights
- Experience added privacy by default
There are multiple ways to set up Google tag gateway for advertisers:
We recommend setting up Google tag gateway for advertisers with a CDN for optimal performance. This is going to look like:
flowchart LR
%% Nodes
subgraph WS["https://example.com"]
WC["Website content"]
GT["Google tag"]
end
CDN["Website CDN"]
CWS["Customer web server"]
GM["Google measurement"]
%% Flows (with directions & labels like the image)
GT --> CDN
CDN --> WC
CDN --> GT
CWS -- "Website content" --> CDN
GM -- "Google tag" --> CDN
CDN -- "Events and conversions" --> GM
If you cannot use a CDN or a Tagging server, you can use our one-click PHP proxy to quickly enable the Google tag gateway for advertisers. It runs directly on your own server and requires minimal configuration. This method is ideal for testing or small-scale use, but it may not provide optimal performance, especially for high-traffic websites.
flowchart LR
%% Nodes
subgraph CWS["Customer web server"]
WC["Website content"]
GT["Google tag"]
PHP["One-click PHP proxy"]
end
GM["Google measurement"]
%% Google tag goes through the proxy path
GM -- "Google tag" --> PHP
PHP -- "Served via /pressidium-cookie-consent-metrics/*" --> GT
%% Google Measurement
GT -- "Requests to /pressidium-cookie-consent-metrics/*" --> PHP
PHP -- "Forwarded events & conversions" --> GM

-
In your WordPress admin dashboard, go to Cookie Consent → Tag Gateway
-
Toggle Google tag gateway proxy to on
This enables the built-in PHP proxy that routes traffic to Google tag gateway
-
Enter your Google tag ID
A Google tag ID is an identifier to load a given Google tag (for more information, refer to Finding your Google tag ID)
-
Click Save to apply your settings
Once enabled, the plugin will automatically serve Google scripts through the following path on your website:
/pressidium-cookie-consent-metrics
You’ll also need to update your Google tag or Google Tag Manager snippet to point to the new measurement path (see below).
You’ll need to update your Google tag script:
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-12345"></script>to use the new measurement path:
<!-- Google tag (gtag.js) -->
<script async src="/pressidium-cookie-consent-metrics/"></script>Replace your Google Tag Manager snippet with the following:
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'/pressidium-cookie-consent-metrics/?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','');</script>
<!-- End Google Tag Manager -->You can find your Google tag ID in several Google products, such as Google Analytics and Google Tag Manager.
- Go to https://analytics.google.com/analytics/web/
- Sign in to your Google Account
- In Admin, under Data collection and modification, select Data Streams
- Select the data stream that you want to edit
- Under Google tag, click Configure tag settings
- Under Your Google tag, click the Google tag (left side of the diagram)
- Under Tag details, copy the Google tag ID
- Go to https://tagmanager.google.com/
- Sign in to your Google Account
- In the Google tags tab, select the Google tag
- Under Your Google tag, click the Google tag (left side of the diagram)
- Under Tag details, copy the Google tag ID
To learn more, checkout out Google’s official guide on how to Find the Google tag ID.
-
In your WordPress admin dashboard, go to Cookie Consent → Tag Gateway
-
Confirm that the “Status” is “Healthy”

This means that the Google tag gateway is reachable and the plugin will route traffic through it.
-
Open your website in a browser
-
Open Developer Tools (e.g. for Google Chrome use
⌘+⌥+Jon macOS orControl+Shift+Jon Windows/Linux) -
Select the Sources tab
-
Confirm that
gtag.jsorgtm.jsis loaded from/pressidium-cookie-consent-metrics/
The plugin automatically registers custom rewrite rules required for the /pressidium-cookie-consent-metrics/* path. However, if you see an “Unreachable” status, you may have to flush rewrite rules manually.

To do this:
- In your WordPress admin dashboard, go to Settings → Permalinks
- Scroll to the bottom of the page (no changes needed)
- Click “Save Changes”
This action flushes the rewrite rules, forcing WordPress to recognize the new /pressidium-cookie-consent-metrics/* path.
Once done, go back to Cookie Consent → Tag Gateway, the status should now appear as “Healthy” meaning the Google tag gateway is reachable.