collective / collective/collective.googleanalytics

Report using filter that contains a variable value

Open
#22 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4
Forks
15
PR merge metrics
No merged PRs in 30d

Description

I have a question. I need a custom report that uses a filter containing a word. How can I define this in Table Rows Expression?

In GA I have: Only show [custom dimension 1 name] Containing [word]
and in Query Explorer I solved using: filters: ga:dimension1=~(word)

In collective.googleanalytics I have now:
Table Rows Expression: python:[row, metric('ga:totalEvents', {'ga:dimension1': row})]
and this returns correct value only when ga:dimension1 == row. I need ga:dimension1 containing row value, but I have no idea how to set this.

This is related to: http://stackoverflow.com/questions/30782980/collective-googleanalytics-report-with-filter-containing-tag
and: http://stackoverflow.com/questions/30776388/ga-query-to-return-unique-count-number

I encountered this problem trying to solve this problem:
I save multiple tags in a custom dimension and I send events for them. I need a custom report that contains each unique tag and the total events for it.

To extract unique tags from registered custom dimension values I use in collective.googleanalytics:
Table Row Repeat Expression: python:[e for i, e in enumerate([item for sublist in dimension('ga:dimension1') for item in sublist.split(",")]) if [item for sublist in dimension('ga:dimension1') for item in sublist.split(",")].index(e) == i]

Is there a solution to fix condition ga:dimension1': row analog to 'containing'?
Or have you any idea how can I solve my report with other settings?

Maybe this will help:
I want to convert this simple one:
![image](https://cloud.githubusercontent.com/assets/3416893/8129985/8c61c3d0-1117-11e5-94cf-1e552ab13a86.png)
to this table (and correct values, too):
![image](https://cloud.githubusercontent.com/assets/3416893/8130017/cd58a4d0-1117-11e5-9a0a-c40ffe05e561.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.