Add or edit a filter at the view level through the API

33 views
Skip to first unread message

Jeroen Sijl

unread,
Aug 31, 2015, 12:32:50 AM8/31/15
to Google Analytics Management API
Hi,
I am using python to access my GA accounts through the google API's/
I managed to get a list of all accounts/profiles and views and a list of the filters in the account.
What I like to get is a list of filters per view and possibly add or edit these filters on view level.
From what I found so far this is only possible at the account level where you can't assign a view to the filer.
Through the web based GA I can change my filters per view.

Is there a way I can do this in python or is this not possible?

Thank you in advance.
G

Mike Sullivan

unread,
Aug 31, 2015, 9:51:37 AM8/31/15
to Google Analytics Management API
Filters are created and managed at the account level and linked to views -- you need to join the two chunks of data to determine which filters are used in which views.

In the web interface, they let you create and edit in the view, but if you look at the account listing, you will see they are all there. It's just a convenience interface.

Matthew Cohoon

unread,
Aug 31, 2015, 11:19:37 AM8/31/15
to Google Analytics Management API
Hi Jeroen,
Mike is correct that Filters are created on the Account level. But the only take affect when linked to a profile. So what you are looking for in the API is the Profile Filter links. Since you already have the list of account/properties/profiles you can then enumerate through them and call

filterLinks = analytics.management().profileFilterLinks().list(
      accountId
=account_id
      webPropertyId
=property_id,
      profileId
=profile_id
 
).execute()

-Matt

On Mon, Aug 31, 2015 at 6:51 AM, Mike Sullivan <mike.3....@gmail.com> wrote:
Filters are created and managed at the account level and linked to views -- you need to join the two chunks of data to determine which filters are used in which views.

In the web interface, they let you create and edit in the view, but if you look at the account listing, you will see they are all there. It's just a convenience interface.

--
You received this message because you are subscribed to the Google Groups "Google Analytics Management API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-analytics-mana...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeroen Sijl

unread,
Aug 31, 2015, 11:26:57 PM8/31/15
to Google Analytics Management API
Hi Matt and Mike,

Thank you! This resolved the issue for me! I didn't know about profile filter links yet!

Greets,
Jeroen
To unsubscribe from this group and stop receiving emails from it, send an email to google-analytics-management-api+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages