PHP Client for Cloudflare API
Client Reference

Google Tag Gateway

Google Tag Gateway: proxies Google Tag Manager and Google Analytics requests through your own zone, so they are served first-party rather than from Google's domains.

Google Tag Gateway: proxies Google Tag Manager and Google Analytics requests through your own zone, so they are served first-party rather than from Google's domains.

Get

Get the Google Tag Gateway configuration for a zone.

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone Identifier.
php
$response = $client->googleTagGateway()->get('ZONE_ID');
View this operation on the Cloudflare API Reference

Update

Update the Google Tag Gateway configuration for a zone.

$client->googleTagGateway()->update('ZONE_ID', [
    'enabled' => true,
    'endpoint' => '/analytics',
    'hideOriginalIp' => false,
    'measurementId' => 'G-XXXXXXXXXX',
]);
ParamTypeRequiredDefaultDescription
zoneIdstringYesZone Identifier.
valuesarrayYesConfiguration: `enabled`, `endpoint`, `hideOriginalIp` and `measurementId` are required, with `setUpTag` optional. `endpoint` is an absolute path with a single alphanumeric segment, e.g. `/analytics`.
php
$response = $client->googleTagGateway()->update('ZONE_ID', []);
View this operation on the Cloudflare API Reference
Copyright © 2026