# Google Tag Gateway # Config ## Get Google Tag Gateway configuration `client.googleTagGateway.config.get(ConfigGetParamsparams, RequestOptionsoptions?): Config` **get** `/zones/{zone_id}/settings/google-tag-gateway/config` Gets the Google Tag Gateway configuration for a zone. ### Parameters - `params: ConfigGetParams` - `zone_id: string` Identifier. ### Returns - `Config` Google Tag Gateway configuration for a zone. - `enabled: boolean` Enables or disables Google Tag Gateway for this zone. - `endpoint: string` Specifies the endpoint path for proxying Google Tag Manager requests. Use an absolute path starting with '/', with no nested paths and alphanumeric characters only (e.g. /metrics). - `hideOriginalIp: boolean` Hides the original client IP address from Google when enabled. - `measurementId: string` Specify the Google Tag Manager container or measurement ID (e.g. GTM-XXXXXXX or G-XXXXXXXXXX). - `setUpTag?: boolean | null` Set up the associated Google Tag on the zone automatically when enabled. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const config = await client.googleTagGateway.config.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(config.hideOriginalIp); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "enabled": true, "endpoint": "/metrics", "hideOriginalIp": true, "measurementId": "GTM-P2F3N47Q", "setUpTag": true } } ``` ## Update Google Tag Gateway configuration `client.googleTagGateway.config.update(ConfigUpdateParamsparams, RequestOptionsoptions?): Config` **put** `/zones/{zone_id}/settings/google-tag-gateway/config` Updates the Google Tag Gateway configuration for a zone. ### Parameters - `params: ConfigUpdateParams` - `zone_id: string` Path param: Identifier. - `enabled: boolean` Body param: Enables or disables Google Tag Gateway for this zone. - `endpoint: string` Body param: Specifies the endpoint path for proxying Google Tag Manager requests. Use an absolute path starting with '/', with no nested paths and alphanumeric characters only (e.g. /metrics). - `hideOriginalIp: boolean` Body param: Hides the original client IP address from Google when enabled. - `measurementId: string` Body param: Specify the Google Tag Manager container or measurement ID (e.g. GTM-XXXXXXX or G-XXXXXXXXXX). - `setUpTag?: boolean | null` Body param: Set up the associated Google Tag on the zone automatically when enabled. ### Returns - `Config` Google Tag Gateway configuration for a zone. - `enabled: boolean` Enables or disables Google Tag Gateway for this zone. - `endpoint: string` Specifies the endpoint path for proxying Google Tag Manager requests. Use an absolute path starting with '/', with no nested paths and alphanumeric characters only (e.g. /metrics). - `hideOriginalIp: boolean` Hides the original client IP address from Google when enabled. - `measurementId: string` Specify the Google Tag Manager container or measurement ID (e.g. GTM-XXXXXXX or G-XXXXXXXXXX). - `setUpTag?: boolean | null` Set up the associated Google Tag on the zone automatically when enabled. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const config = await client.googleTagGateway.config.update({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', enabled: true, endpoint: '/metrics', hideOriginalIp: true, measurementId: 'GTM-P2F3N47Q', }); console.log(config.hideOriginalIp); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "enabled": true, "endpoint": "/metrics", "hideOriginalIp": true, "measurementId": "GTM-P2F3N47Q", "setUpTag": true } } ``` ## Domain Types ### Config - `Config` Google Tag Gateway configuration for a zone. - `enabled: boolean` Enables or disables Google Tag Gateway for this zone. - `endpoint: string` Specifies the endpoint path for proxying Google Tag Manager requests. Use an absolute path starting with '/', with no nested paths and alphanumeric characters only (e.g. /metrics). - `hideOriginalIp: boolean` Hides the original client IP address from Google when enabled. - `measurementId: string` Specify the Google Tag Manager container or measurement ID (e.g. GTM-XXXXXXX or G-XXXXXXXXXX). - `setUpTag?: boolean | null` Set up the associated Google Tag on the zone automatically when enabled.