0
votes

I am not sure what's the easiest way to import audiences from BigQuery to Google Analytics. I have a BigQuery table called dataset_a.georgia with 2 columns fullVisitorId (string) and predictions (string).

enter image description here

Based on CRMint documentation, there is a worker called GAAudiencesUpdater which is doing what I am looking for. GAAudiencesUpdater Parameters

However, one of the required parameters is a GA audience JSON template. I have a hard time to understand how exactly I should write this JSON as the basic JSON example is pretty long and hard to understand. I just have 2 columns to import, the fullVisitorId is already a default variable in Google Analytics while I just created a custom dimension called predictions with the index 183 and user scope.

I talked to a senior developer who had a bit of experience with CRMint and he suggested me to not use the GAAudiencesUpdater because of how hard it is to write the GA audience JSON template. He suggested me to import my BigQuery data into a CSV, store that CSV into Google Cloud Storage before to import that CSV to Google Analytics with the worker to GADataImporter.

Any suggestions?

2

2 Answers

1
votes

They updated the version. You don't have to import JSON now.

0
votes

You can find here an example

GAAudiencesUpdater

Here's the basic Google Analytics JSON template example:

{
  "audienceType": "STATE_BASED",
  "linkedAdAccounts": [
    {
      "linkedAccountId": "{% AW_ACCOUNT_ID %}",
      "type": "ADWORDS_LINKS"
    }
  ],
  "linkedViews": [
    {% GA_VIEW_ID %}
  ],
  "name": "CRMint Tier GA %(tier)i",
  "stateBasedAudienceDefinition": {
    "includeConditions": {
      "daysToLookBack": 7,
      "segment": "users::condition::ga:dimension{% CD_TIER %}=@%(code)s",
      "isSmartList": false,
      "membershipDurationDays": %(duration)i
    },
    "excludeConditions": {
      "segment": "users::condition::ga:dimension{% CD_TIER %}==dur93j#%(tier)ihg@2d6",
      "exclusionDuration": "TEMPORARY"
    }
  }
}