Forwarding - Google Analytics 4 Measurement Protocol
  • 17 Jul 2024
  • PDF

Forwarding - Google Analytics 4 Measurement Protocol

  • PDF

Article summary

summary

Help page for setting up data transfer to Google Analytics 4 Measurement Protocol.

  • Data can be extracted from any source and sent to Measurement Protocol (Google Analytics 4).
  • It is necessary to map column names and types in TROCCO when creating the transfer settings to conform to the Measurement Protocol format.

constraints

  • API restrictions apply.
  • One event is created per line of input.
    • Multiple inputs cannot be combined to create multiple events.

supplement

The forwarded Google Analytics 4 Measurement Protocol does not use connection information.

Setting items

STEP1 Basic settings

item nameindispensabledefault valueContents
API SecretYes-Enter the API secret of the data stream.
For details on how to check, please refer to How to Check Measurement ID and API Secret.
Measurement IDYes-Enter the measurement ID of the data stream.
For details on how to check, please refer to How to Check Measurement ID and API Secret.
Request VerificationYesvalidityWhen enabled, the Measurement Protocol validation server verifies that the format of the event to be sent is correct.
At this time, if the request contains a malformed event, the TROCCO transfer job will be marked as Error.
Note that regardless of whether you choose to enable or disable, the transfer will be performed for events in the correct format.

STEP2 Detailed settings

column mapping

In the column definitions in STEP 2 of TROCCO, data can be sent to the Google Analytics 4 Measurement Protocol by mapping column names and types.
Match column names and types as shown in the table below.
For other columns, please refer to the API documentation.

column nametype (e.g. of machine, goods, etc.)indispensable
client_idstringYes
events.namestringYes
events.params.${parameter name}Any typeNo
events.params.items.${parameter name}Any typeNo
user_properties.${parameter name}Any typeNo

Input Example

  • In the following example input, two offline_purchase events and one search event are created.
    • client_id:. x There are two events for, one event is created for each line of input.
  • See the API documentation for details on events and user properties.
client_ide valueevents.params.search_termevents.params.items.item_idevents.params.items.item_nameuser_properties.customer_tieruser_properties.age
an unknownoffline_purchaseUSD100nullSKU_12345Stan and Friends Teestandardnull
an unknownoffline_purchaseUSD200nullSKU_67890pN and Friends Teestandardnull
Ysearchnullnullt-shirtsnullnullpremium30

How to confirm measurement ID and API secret

The following steps can be taken to check.

  1. From the Google Analytics 4 home screen, click Manage
    image

  2. Select any property and click on Data Stream
    image

  3. Click on any data stream
    image

    You can check the measurement ID.

  4. Click on Measurement Protocol API secret
    image

    You can check the value of the API secret.
    image


Was this article helpful?