rishuk51 / analytics-issues

Automatically exported from code.google.com/p/analytics-issues
0 stars 0 forks source link

Filter Insert for Custom Dimensions Throwing Error #678

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
---------------------------------------------------------------------------
NOTE: This issue tracking system is for Google Analytics developer products
only.
If you are not a developer/programmer visit:
http://www.google.com/analytics/support.html
---------------------------------------------------------------------------
Name of affected component: Management API

Name of related library and version, if applicable (e.g. Java, Python,
HTTP, etc.):
Python

Issue summary:
Provide a brief summary of the issue you're experiencing.
The insert method for filter (only for the CUSTOM_DIMENSION field type) is 
responding with a 500 error both when I run my script and when using the API 
Explorer.

Steps to reproduce issue:
Use analytics.management().filter().insert() to create a custom dimension-based 
filter.

Actual results:
What do you actually see after performing the above steps?

500 error with response:
AttributeError: 'Resource' object has no attribute 'filter'

Notes:
All other filter types seem to work, just the custom dimension ones throw an 
error.

Original issue reported on code.google.com by SBarnes...@gmail.com on 25 Jun 2015 at 7:19

GoogleCodeExporter commented 8 years ago
Your code should be filters() with an s:
analytics.management().filters().insert(
   accountId=accountId,
   body = {
    ...
  }
)

Can you include the request and the full response for the request that returns 
a 500 from the API?

Also if you are using an includeDetails/excludeDetails be sure that you use the 
matchType: "MATCHES" all other match types will not work with CUSTOM_DIMENSIONS 
and be sure to supply the fieldIndex for the proper index of the custom 
dimension you wish to filter.

Original comment by mcoh...@google.com on 4 Aug 2015 at 4:36