Importing Custom Variable in Google Analytics to Metabase

Hi guys,

I can’t import our Google Analytics account’s custom dimensions to Metabase.

The only way to do it, to my knowledge, is using the native mode to tweak the query, as if performing an API call. I would want to add at least one custom dimension to the data model.

Anyone with the same problem?

EDIT: for the sake of clarity, custom dimensions are configured at the property level.

1 Like

Hey @jascensao it looks like MetaBase imports this using the generic name ‘Custom Dimension XX’

If you write the query using the GA JSON syntax (instead of visual builder) it should work fine.

For the life of me, I am not able to figure out how to import this information. I gave gone in to try using admin and cannot get the data to come in. I can see the data in GA but need it within my dashboard. Any suggestions?

Tom

Was just trying to do this myself, so figured I would post here. As @toddheslin mentioned, you need to write a native query. This is an example one that filters a custom dimension dimension1 and groups by it.

{
  "ids": "ga:1234567",
  "start-date": "180daysAgo",
  "end-date": "today",
  "metrics": "ga:totalEvents",
  "dimensions": "ga:dimension1,ga:eventLabel",
  "filters": "ga:eventCategory==SomeCategory;ga:eventAction==SomeAction;ga:dimension1=~^ABC.*",
  "include-empty-rows": false,
  "max-results": 10000
}

I'm not too familiar with this type of sql so could you clarify what I would need to replace in your query? I have a custom dimension called "userrole" that I'd like to report. Would I replace dimension1 with "userrole"?