1
votes

I am currently working with the Google Analytics v3 C# API and am trying to put together a very large filter that reflects a filter that my client uses within their Analytics account.

I have determined that the Filter data size is too large for me to create from scratch and send in my request. Is it possible to apply the existing saved Filter that my client uses within their Analytics account? I know the name of the filter they use.

Edit: It looks like what I need is to be able to do is apply a saved segment. Using query explorer, I can get the custom segment id. But now I am getting an error saying that my user does not have access to that segment. Any idea where to grant permission to segments for an api account? Thanks.

Thanks in advance for your help.

JH

1
Quite possibly. There are limits configured on this kind of thing all over .Net. Like I said, use fiddler to view the HTTP. Does it even produce a HTTP request? - Liam
Actually, I am seeing the request to Google. Fiddler tells me that I sent 7,018 bytes. And the response body has the error: message=Invalid expression. Expression exceeds max size of 4096 - jay
Since Google is complaining of the request size, I suppose that leads me back to Question #1. Is it possible to use an existing saved Filter? - jay
This is what the Response body looks like: JSON -error code=400 errors domain=global message=Invalid expression. Expression exceeds max size of 4096 reason=badRequest message=Invalid expression. Expression exceeds max size of 4096 - jay
That looks like a google error to me. So your right google obviously caps the HTTP request. You should edit your question to change the focus on what you want now. Unfortunatly I don't know the answer to using an existing report. My guess is yes, but I'm not sure how, sorry - Liam

1 Answers

0
votes

I was able to resolve this issue by granting my api service account collaborator rights in analytics and sharing the user-defined segment with collaborators. Then added the segment using the API and segment id.