ePrivacy and GPDR Cookie Consent by Cookie Consent Skip to main content

Google Analytics Destination

1. Steps to implement Google Analytics destination

  1. Create a task in #help_product to create the destination in Business Explorer (CDP).

    For on-premise implementation, instructions may be given by product team for clients to execute.

  2. Create a workspace in Meiro Integrations (MI) for the Google Ads destination. This is the workspace that will run when the user clicks on "Export" in the segment builder.
  3. The workspace consists of a CDP Destination connector, a processor, and a Google Analytics Audience loader.
  4. In Business Explorer, select the MI workspace under Meiro Integrations that you have created for the Google Analytics Audience.
  5. Set up an attribute for "All GA IDs in the last X days" where X is somewhere between 30 and 90 days, as well as the attribute definition in Customer Data Model (CDM).
  6. Go to Administration > Entities > Destinations > image-1617862210083.png (pencil icon) Edit
  7. Add the created attribute under exported attributes and mandatory attribute.
  8. Add under Parameters: ga_audience_name. This parameter will show up in the segment builder when user chooses GA destination as an export destination. It will be populated into the MI workspace variable of the same name: ga_audience_name with the value that the user fills in.

image-1617863188008.png

If you defined parameters, you must make sure the Meiro Integrations Key matches the Workspace variable name in the chosen MI workspace.

When you are done, you should see the destination under Administration > Entities > Destinations (Example below)

image-1617863119105.png

Note down the ID of the destination, you will need it for the CDP Destination connector configuration

2. Configurations for Workspace in Meiro Integrations

CDP Destination connector
  • You will need to setup the MI API credentials and on the CDP
  • You will require the CDP API credentials for this connector.
  • The "Export Destination ID" is the ID of the CDP Destination for Google Analytics that is setup in Business Explorer.
  • You will require the credentials for the CDP database as well.
  • The output of this configuration is /data/out/tables/export.csv. Your processor will need to move it into /data/out/files/export.csv after processing.

image-1617862949015.png

Processor
  • There should be no need to further enrich the data as it is already in the format that can be used for the loader. Therefore, you can simply use a Command Line Interface Code processor to run a bash shell command to move the file to the location needed for the loader: mv/data/in/tables/export.csv/data/out/files/export.csv
Google Analytics Audience loader
  • The loader expects the exported audience segment to be in the path:  /data/in/files/export.csv 
  • The export.csv file will have a column header for the google analytics id, this would be the attribute id for the exported google analytics id attribute as defined in Business Explorer when setting up destination.
  • The setting: "Google Client ID Column Name" in the loader setting corresponds to the column/header name for the google analytics id from the input csv file export.csv 
  • Set the GA property and Audience Name to the workspace variables ga_property and ga_audience_name respectively. You will have to obtain the values for them from the client.

image-1617862734507.png

3. FAQ

Why do the GA IDs need to be in a JSON array format? eg. ["1234567890.1234567890"]

The format for GA ID is JSON array as 1 customer (1 line in export from CDP) can have multiple values for an attribute. If attributes is_unique = 0, then it will have the array containing all values for this attribute. Also, the loader expects the google analytics id to be in a JSON array. It iterates through the ids contained in the array when loading them into Google Analytics.

Why is there no authentication required for this loader?

We are using Measurement Protocol to send events with specific name and value and segment in GA based on this. Read https://docs.meiro.io/books/meiro-business-explorer/page/set-export-destination-to-google-analytics-google-ads-work and https://developers.google.com/analytics/devguides/collection/protocol/v1

How do I test out the loader after I am done setting up the workspace to confirm that it works before going to the client?

Point 4 in https://docs.meiro.io/books/meiro-business-explorer/page/export-your-segment-how-to-export-my-audience-to-google-analytics-and-google-ads