GhitaB
GhitaB

Reputation: 3437

collective.googleanalytics report with filter containing tag

I use collective.googleanalytics for a plone website and I try to create a custom report that contains a list of tags and totalEvents for each one.

I have: Table Rows Expression: python:[row, metric('ga:totalEvents', {'ga:dimension1': row})] where row is the name for my tag and it appear in first column of my custom report.

The problem is I save multiple tags in custom dimension ga:dimension1. So in my report using this setting I receive the correct number only for the case where I have a single tag in custom dimension, but 0 in case that there are multiple tags in ga:dimension1.

I solved with Query Explorer a report and it seems I need a filter like ga:dimension1=~(Computer) to receive the correct number. (This question is related to: GA query to return unique count number).

So, my question is how can I use Table Rows Expression field in collective.googleanalytics to define this value like ~(tag)?

UPDATE: More details here: https://github.com/collective/collective.googleanalytics/issues/22

Upvotes: 2

Views: 150

Answers (1)

Ionică Bizău
Ionică Bizău

Reputation: 113425

It seems that this is a limitation in collective.googleanalytics -- it only checks the equality relation:

python:[row, metric('ga:totalEvents', {'ga:dimension1': row})]

A hack is to bring all the data you need on the client and use JavaScript on the client side to filter the needed data.

Also, currently, collective.googleranalytics does not support ga:dimension at all. There is a pull request implementing that which is not merged yet.

Upvotes: 1

Related Questions