Data Destination - Google Analytics 4 Measurement Protocol
  • 20 Feb 2023
  • Dark
    Light
  • PDF

Data Destination - Google Analytics 4 Measurement Protocol

  • Dark
    Light
  • PDF

Article Summary

Note

This is a machine-translated version of the original Japanese article.
Please understand that some of the information contained on this page may be inaccurate.

summary

This page is a help page for setting up data transfer to Google Analytics4 Measurement Protocol.

  • Data can be extracted from any source and sent to the Measurement Protocol.
  • According to the format of the Measurement Protocol, column names and types must be mapped on trocco.

constraint

  • API limitations apply.
  • One event is created for each line of input.
    • You cannot combine multiple inputs to create multiple events.

supplement

The destination Google Analytics4 Measurement Protocol does not use connection information.

Setting items

STEP1 Basic settings

Itemnamerequireddefault
valuecontent
API SecretYes-Enter the API secret for the data stream.
For details on how to check the measurement ID and API secret, refer to How to check the measurement ID and API secret.
Measurement IDYes-Enter the measurement ID for the data stream.
For details on how to check the measurement ID and API secret, refer to How to check the measurement ID and API secret.
Request validationYesvalidWhen you select Enabled, the Measurement Protocol validation server verifies that the events being sent are in the correct format.
In this case, if the request contains a malformed event, the trocco transfer job will be Error.
Regardless of whether you select Enable or Disable, events in the correct format will be forwarded.

STEP2 Advanced settings

Column Mapping

By mapping column names and types in trocco's STEP2 column definitions, you can send data to Google Analytics4 Measurement Protocol.
Make sure that the column names and types match as shown in the following table.
For other columns, see the API documentation.

Column NameTypeRequired
client_idstringYes
events.namestringYes
events.params.${parameter name}Any typeNo
events.params.items.${parameter name}Any typeNo
user_properties.${parameter name}Any typeNo

Example input

  • In the following example input, two offline_purchase events and onesearchevent are created.
    • client_id: x There are two events, but one event is created for each input line.
  • For more information about events and user properties, see the API documentation.
client_idevents.nameevents.params.currencyevents.params.valueevents.params.search_termevents.params.items.item_idevents.params.items.item_nameuser_properties.customer_tieruser_properties.age
xoffline_purchaseUSD100nullSKU_12345Stan and Friends Teestandardnull
xoffline_purchaseUSD200nullSKU_67890pN and Friends Teestandardnull
ysearchnullnullt-shirtsnullnullpremium30

How to find your Measurement ID and API secret

You can check it by following the steps below.

  1. From the Google Analytics4 home screen, click Manage
    image

  2. Select any property and click the data stream
    image

  3. Click any data stream
    image

    You can check the measurement ID.

  4. Click Measurement Protocol API secret
    image

    You can check the value of the API secret.
    image


Was this article helpful?