Google Analytics 360 - Custom Variables

When setting up a Data Exports integration, you can choose Google Analytics 360 compatible as the output format. If you do so, you can choose to provide a configuration JSON in the “Custom dimensions config” field. This JSON will map each Marfeel custom variable to a Variable ID in the Google Analytics format.

Marfeel has four different custom variables:

In the configuration JSON, create an array with each position mapping a variable name to its source (type) and an ID (integer). For example:

{
  "hitMappings": [
    {
      "index": 1,
      "source": "PAGE_VARS",
      "varName": "my_pagevar"
    },
    {
      "index": 2,
      "source": "TAGS",
      "varName": "my_tagGroup"
    }
  ],
  "globalMappings": [
    {
      "index": 1,
      "source": "USER_VARS",
      "varName": "my_uservar"
    }
  ]
}

Variables defined in hitMappings will be output as an array in hits.customDimensions, while variables defined in globalMappings will be output as an array in customDimensions. Each variable will be represented by its index and value (name will not be present). For example:

{
  "hits": [
    {
      "customDimensions": [
        {
          "index": "1",
          "value": "0.023"
        },
        {
          "index": "2",
          "value": "foo"
        }
      ]
    }
  ],
  "customDimensions": [
    {
      "index":"1",
      "value": "bar"
    }
  ]
}
``