DestinationsConnect GA4 (tagless)

Connect GA4 (tagless)

One-click GA4 measurement with no page tag — creates (or updates) the google_analytics Data Manager server destination, mapped to the Mythic commerce spec. Server-only by design: Mythic is the single source, so every event arrives with resolved identity and full line items (cart_data), which a browser tag cannot supply once an ad blocker is in play. There is no browser half, so the response always has browser_tag false and tag_id null.

event_mapping defaults to the whole commerce spec — identity names, since the spec uses GA4's own — and anything you pass is MERGED over that default. cart_data is the opposite: an explicit object REPLACES the default wholesale. Requires the google_analytics Data Manager OAuth credential to be stored first.

curl -X POST "https://mythic-analytics.gulp.workers.dev/client/v1/destinations/integrations/google_analytics" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "measurement_id": "G-TWL9RRGMYF",
  "property_id": "426621937",
  "event_mapping": {},
  "cart_data": {},
  "client_id_strategy": "example_string",
  "debug_mode": true
}'
{
  "success": true,
  "data": {
    "platform": "example_string",
    "destination_id": "example_string",
    "tag_id": "example_string",
    "browser_tag": true
  }
}
POST
/client/v1/destinations/integrations/google_analytics
POST
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

Client key as bearer token. Use an agency key (Bearer ak_...) for read-write access or a location secret key (Bearer sk_...) for read-only access. Scoped keys (mcp_) are accepted too and need destinations:read or destinations:write. See Using an mcp_ key over HTTP.

Client key as bearer token. Use an agency key (Bearer ak_...) for read-write access or a location secret key (Bearer sk_...) for read-only access. Scoped keys (mcp_) are accepted too and need destinations:read or destinations:write. See Using an mcp_ key over HTTP.
Content-Typestring
Required

The media type of the request body

Options: application/json
measurement_idstring
Required

GA4 measurement id.

Pattern: ^G-[A-Z0-9]{4,20}$
property_idstring
Required

Numeric GA4 property id. The Data Manager API addresses the property by this, not by the measurement id.

Pattern: ^\d{6,20}$
event_mappingobject

Mythic event name -> GA4 event name. Merged OVER the commerce-spec default, so omit it unless renaming.

cart_dataobject

Google CartData config. REPLACES the commerce default wholesale — pass it only if your items live somewhere other than "items".

client_id_strategystring

How to derive the GA4 client id without a page tag.

debug_modeboolean

Route events into GA4 DebugView. Debug events are EXCLUDED from reports — leave off in production.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. Client key as bearer token. Use an agency key (Bearer ak_...) for read-write access or a location secret key (Bearer sk_...) for read-only access. Scoped keys (mcp_) are accepted too and need destinations:read or destinations:write. See Using an mcp_ key over HTTP.

Body

application/json
measurement_idstring
Required

GA4 measurement id.

Example:
G-TWL9RRGMYF
property_idstring
Required

Numeric GA4 property id. The Data Manager API addresses the property by this, not by the measurement id.

Example:
426621937
event_mappingobject

Mythic event name -\> GA4 event name. Merged OVER the commerce-spec default, so omit it unless renaming.

cart_dataobject

Google CartData config. REPLACES the commerce default wholesale — pass it only if your items live somewhere other than "items".

client_id_strategystring

How to derive the GA4 client id without a page tag.

debug_modeboolean

Route events into GA4 DebugView. Debug events are EXCLUDED from reports — leave off in production.

Responses