- 20 Feb 2023
- 1 Minute to read
-
Print
-
DarkLight
Data Destination - Google Analytics 4 Measurement Protocol
- Updated on 20 Feb 2023
- 1 Minute to read
-
Print
-
DarkLight
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.
- See the API documentation for details.
- 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
Item | namerequireddefault | valuecontent | |
---|---|---|---|
API Secret | Yes | - | 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 ID | Yes | - | 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 validation | Yes | valid | When 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 Name | TypeRequired | |
---|---|---|
client_id | string | Yes |
events.name | string | Yes |
events.params.${parameter name} | Any type | No |
events.params.items.${parameter name} | Any type | No |
user_properties.${parameter name} | Any type | No |
Example input
- In the following example input, two
offline_purchase
events and onesearch
event 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_id | events.name | events.params.currency | events.params.value | events.params.search_term | events.params.items.item_id | events.params.items.item_name | user_properties.customer_tier | user_properties.age |
---|---|---|---|---|---|---|---|---|
x | offline_purchase | USD | 100 | null | SKU_12345 | Stan and Friends Tee | standard | null |
x | offline_purchase | USD | 200 | null | SKU_67890 | pN and Friends Tee | standard | null |
y | search | null | null | t-shirts | null | null | premium | 30 |
How to find your Measurement ID and API secret
You can check it by following the steps below.
From the Google Analytics4 home screen, click Manage
Select any property and click the data stream
Click any data stream
You can check the measurement ID.
Click Measurement Protocol API secret
You can check the value of the API secret.