Pinned topic Google Analytics
I am using Cast Iron to send an HTTP GET request to the Google Analytics API to perform several queries. The problem is when I send my HTTP GET request I receive the following message, "The request operation failed . Exception: Received Http Code:400 from www.googleapis.com." The 400 error code indicates there is something in the query string that is not correct. Here is a sample of my query string, https://www.googleapis.com/analytics/v3/data/ga? and also utilizing the following URI, ids=ga%3AXXXXXXX&dimensions=ga%3AvisitorType%2Cga%3AvisitCount%2Cga%3AdaysSinceLastVisit%2Cga%3AuserDefinedValue&metrics=ga%3Avisitors&start-date=2012-11-29&end-date=2012-12-13&max-results=10000. I am also providing an authorization token as a header item in my GET request.
To build the query string I used http://ga-dev-tools.appspot.com/explorer/. I have tried using as few as one metric and I also tried switching between tables to see if that made a difference, but I have had no luck in getting my query to work.
Does anyone have experience with the Google Analytics API and know why I would be receiving the 400 error code?
Please let me know if I need to provide any more information.
DGarriott 270004E2P38 Posts
ESBDeveloper 270002CRFF1 Post
Re: Google Analytics2015-03-11T20:14:01ZThis is the accepted answer. This is the accepted answer.
- DGarriott 270004E2P3
I know it was while a ago you may worked on this. I am also working on the similar requirement pulling the data from Google analytics. I ama able to get eh token and then when trying to fetch the data it is failing to connect to get http activity and throwing below error. Any idea about the below error. Can you please give mfew details how you are trying to retrieve the data like which activity you are using and what are the high level params etc
"The send request failed. Exception: Error while parsing the host port. Incorrect port number:"
tejasgarge 310001N6WP1 Post
Re: Google Analytics2015-12-18T11:28:06ZThis is the accepted answer. This is the accepted answer.
- ESBDeveloper 270002CRFF
For your problem below :"The send request failed. Exception: Error while parsing the host port. Incorrect port number:"
while configuring the call for the URI , you might have sending addition optional httpConnParameter which contains host and port , which is not required to be send.
so remove that httpConnParameter. This happens when you try setup configuration properties for timeout which has default value as 300.
this automatically start sending extra parameter which is not required.
Please check your Get Request activity for fetching data from Google analytics , in Map Input , " to Activity " , you shoud only see httpheaders not httpConnParameter in addition remove httpConnParameter , it will work.
vti 3100016G2N7 Posts
Re: Google Analytics2015-12-23T07:14:21ZThis is the accepted answer. This is the accepted answer.Hello, Hi, I'm trying to generate a signature to authenticate to a vendor's REST API. Generate HMAC and then base64 Compliant Signature-has anyone used this CI Function?