# Google Tag Gateway # Config ## Get Google Tag Gateway configuration `client.GoogleTagGateway.Config.Get(ctx, query) (*Config, error)` **get** `/zones/{zone_id}/settings/google-tag-gateway/config` Gets the Google Tag Gateway configuration for a zone. ### Parameters - `query ConfigGetParams` - `ZoneID param.Field[string]` Identifier. ### Returns - `type Config struct{…}` Google Tag Gateway configuration for a zone. - `Enabled bool` 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 bool` 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 bool` Set up the associated Google Tag on the zone automatically when enabled. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/google_tag_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) config, err := client.GoogleTagGateway.Config.Get(context.TODO(), google_tag_gateway.ConfigGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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(ctx, params) (*Config, error)` **put** `/zones/{zone_id}/settings/google-tag-gateway/config` Updates the Google Tag Gateway configuration for a zone. ### Parameters - `params ConfigUpdateParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Config param.Field[Config]` Body param: Google Tag Gateway configuration for a zone. ### Returns - `type Config struct{…}` Google Tag Gateway configuration for a zone. - `Enabled bool` 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 bool` 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 bool` Set up the associated Google Tag on the zone automatically when enabled. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/google_tag_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) config, err := client.GoogleTagGateway.Config.Update(context.TODO(), google_tag_gateway.ConfigUpdateParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Config: google_tag_gateway.ConfigParam{ Enabled: cloudflare.F(true), Endpoint: cloudflare.F("/metrics"), HideOriginalIP: cloudflare.F(true), MeasurementID: cloudflare.F("GTM-P2F3N47Q"), }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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 - `type Config struct{…}` Google Tag Gateway configuration for a zone. - `Enabled bool` 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 bool` 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 bool` Set up the associated Google Tag on the zone automatically when enabled.