Creating a Google Analytics 4 Configuration
Using the POST method with the Google Analytics 4 endpoint will allow you to create a new Integration Configuration that will describe where and how to push Marketing Edge data to your Google Analytics 4 account.
POSThttps://edgeapi.marchex.io/marketingedge/v5/api/IntegrationConfigurations/GoogleAnalytics4
The following sample request can be used to create a GA4 Integration Configuration
{
"configuration_name": "GoogleAnalytics4 Integration Name",
"configuration": {
"measurement_id": "5244322e-083f-4574-bdea-64c824831ca4",
"api_secret": "secret-key"
},
"config_data": {
"session_based_dni_upload_criteria": "All",
"events": [
{
"name": "Name",
"call_criteria": "AllMatchedCalls",
"min_duration_value": 0
}
],
"event_parameters": [
{
"name": "Name",
"static_value": true,
"value": "1"
}
],
"user_parameters": [
{
"name": "Name",
"static_value": true,
"value": "1"
}
]
},
"domain_access": {
"billing_groups": [
"4455",
"4456"
],
"group_owners": [
"33344",
"44433"
]
},
}If the request is handled successfully, the following response will be returned:
{
"integration_configuration_id": "7d58c388-2acf-40a4-9836-54b770270677",
"configuration_name": "GoogleAnalytics4 Integration Name",
"type": "GoogleAnalytics4",
"configuration": {
"measurement_id": "5244322e-083f-4574-bdea-64c824831ca4",
"api_secret": "secret-key"
},
"config_data": {
"session_based_dni_upload_criteria": "All",
"events": [
{
"name": "Name",
"call_criteria": "AllMatchedCalls",
"min_duration_value": 0
}
],
"event_parameters": [
{
"name": "Name",
"static_value": true,
"value": "1"
}
],
"user_parameters": [
{
"name": "Name",
"static_value": true,
"value": "1"
}
]
},
"status": "enabled",
"domain_access": {
"billing_groups": [
"4455",
"4456"
],
"group_owners": [
"33344",
"44433"
]
},
"created_datetime": "2023-04-06T13:35:07.931Z",
"modified_datetime": "2023-04-06T13:35:07.931Z"
}Fields that are used when creating a GA4 Integration Configuration
| Parameter | Type | Details | Other |
|---|---|---|---|
| configuration_name | string | Required | |
| configuration -> measurement_id | string | Required | |
| configuration -> api_secret | string | Required | |
| config_data -> session_based_dni_upload_criteria | string |
| Required |
| events | array | Array of Events Min = 1 Max = 10 | |
| events -> name | string | ||
| events -> call_criteria | string |
| |
| events -> min_duration_value | int | Required If call_criteria is set to Min Duration | |
| events -> call_tag | string | call_tag_id | Required If call_criteria is set to Call Tag |
| event_parameters | array | Array of Event_Parameters Min = 0 Max = 25 | |
| event_parameters -> name | string | ||
| event_parameters -> static_value | boolean | true, false | |
| event_parameters -> value | string | static = true, user provided value static = false, see below for valid options | |
| user_parameters | array | Array of User_Parameters Min = 0 Max = 25 | |
| user_parameters -> name | string | ||
| user_parameters -> static_value | boolean | true, false | |
| user_parameters -> value | string | static = true, user provided value static = false, see below for valid options | |
| domain_access | object | Minimum of one billing_group or group_owner | |
| domain_access -> billing_groups | array | Array of billing_group_id | |
| domain_access -> group_owners | array | Array of group_owner_id |