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.

POST https://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

ParameterTypeDetailsOther
configuration_namestringRequired
configuration -> measurement_idstringRequired
configuration -> api_secretstringRequired
config_data -> session_based_dni_upload_criteriastring- All
- Session-Matched
- Google Client ID
Required
eventsarrayArray of Events
Min = 1
Max = 10
events -> namestring
events -> call_criteriastring- All Matched Calls
- Min Duration
- Call Tag
events -> min_duration_valueintRequired If call_criteria is set to Min Duration
events -> call_tagstringcall_tag_idRequired If call_criteria is set to Call Tag
event_parametersarrayArray of Event_Parameters
Min = 0
Max = 25
event_parameters -> namestring
event_parameters -> static_valuebooleantrue, false
event_parameters -> valuestringstatic = true, user provided value
static = false, see below for valid options
user_parametersarrayArray of User_Parameters
Min = 0
Max = 25
user_parameters -> namestring
user_parameters -> static_valuebooleantrue, false
user_parameters -> valuestringstatic = true, user provided value
static = false, see below for valid options
domain_accessobjectMinimum of one billing_group or group_owner
domain_access -> billing_groupsarrayArray of billing_group_id
domain_access -> group_ownersarrayArray of group_owner_id

List of supported Values for event_parameters and user_parameters