getredash/redash · error · Exception
Can't mix mcf: and ga: dimensions.
Error message
Can't mix mcf: and ga: dimensions.
What it means
Same ga:/mcf: separation rule as error 26 but for dimensions: params['dimensions'] may not contain both 'mcf:' and 'ga:' prefixes because the core and Multi-Channel Funnels endpoints each accept only their own namespace.
Source
Thrown at redash/query_runner/google_analytics.py:171
service = self._get_analytics_service()
service.management().accounts().list().execute()
except HttpError as e:
# Make sure we return a more readable error to the end user
raise Exception(e._get_reason())
def run_query(self, query, user):
logger.debug("Analytics is about to execute query: %s", query)
try:
params = json_loads(query)
except Exception:
query_string = parse_qs(urlparse(query).query, keep_blank_values=True)
params = {k.replace("-", "_"): ",".join(v) for k, v in query_string.items()}
if "mcf:" in params["metrics"] and "ga:" in params["metrics"]:
raise Exception("Can't mix mcf: and ga: metrics.")
if "mcf:" in params.get("dimensions", "") and "ga:" in params.get("dimensions", ""):
raise Exception("Can't mix mcf: and ga: dimensions.")
if "mcf:" in params["metrics"]:
api = self._get_analytics_service().data().mcf()
else:
api = self._get_analytics_service().data().ga()
if len(params) > 0:
try:
response = api.get(**params).execute()
data = parse_ga_response(response)
error = None
except HttpError as e:
# Make sure we return a more readable error to the end user
error = e._get_reason()
data = None
else:
error = "Wrong query format."
data = NoneView on GitHub (pinned to ca79fe988d)
Solutions
- Use only ga: dimensions for core queries and only mcf: dimensions for MCF queries — run two separate queries
- Drop the mcf: dimension if MCF data isn't needed
Example fix
// before
{"metrics": "mcf:totalConversions", "dimensions": "ga:date,mcf:sourcePath"}
// after
{"metrics": "mcf:totalConversions", "dimensions": "mcf:date,mcf:sourcePath"} Defensive patterns
Strategy: validation
Validate before calling
def dimensions_are_consistent(dims: str) -> bool:
return not ("mcf:" in dims and "ga:" in dims) Prevention
- Use one namespace per query for dimensions and metrics alike
- Split MCF reports into dedicated queries
When it happens
Trigger: A query whose dimensions list mixes namespaces, e.g. {"dimensions": "ga:date,mcf:sourcePath"}, checked right after the metrics check in run_query.
Common situations: Combining core dimensions with MCF path dimensions in one visualization; adapting an MCF report into Redash.
Related errors
- Can't mix mcf: and ga: metrics.
- Results format not supported
- Unknown date/time format in results: '{}'
- Failed getting accounts.
- Query is empty.
AI-assisted analysis of getredash/redash@ca79fe988d (2026-08-28).
Data as JSON: /api/errors/42665ea5eed55b0a.
Report an issue: GitHub.