How to pass start_date and end_date to superProxy?

194 views
Skip to first unread message

Fatih Sen

unread,
Oct 15, 2013, 11:37:34 AM10/15/13
to google-analyti...@googlegroups.com
I setup the superProxy and everything works fine. However, I want to get the reporting data according to dates. I know that the Google Analytics superProxy does not provide that feature. How can I change superProxy's source code to accomplish that? It is written in Python and I don't have any serious experience that programming language. Could you help me with that please?

Pete

unread,
Oct 15, 2013, 10:18:26 PM10/15/13
to google-analyti...@googlegroups.com
I'm not sure I understand the request. Can you provide more details on the use case and what you're trying to do (an example)?

Fatih Sen

unread,
Oct 16, 2013, 11:52:16 AM10/16/13
to google-analyti...@googlegroups.com

For example, in Google Apps Script, I am using this url to get json response below. Then I iterate the response through rows and columns and get the output(chart, datatable, ...etc.)

var url = "https://yourappid.appspot.com/query?id=ahVzfmFuYWx5dGljc2FwcDRhY3hpb21yFQsSCEFwaVF1ZXJ5GICAgICA8ogKDA&format=json";
var response = UrlFetchApp.fetch(url);
var jsonResponse  = Utilities.jsonParse(response.getContentText());

var chartBuilder = Charts.newDataTable()
                   
    .addColumn(Charts.ColumnType.NUMBER, "Avg. Visit Duration")
 
  var rows = jsonResponse["rows"];
  var columns = jsonResponse["columnHeaders"];
  for(var i=0; i < rows.length; i++){
      chartBuilder.addRow(rows[i]);
      avgVisitDurationVal = rows[i][0]
  }
...................................
...................................
...................................

That url only includes the id of the query which was pre-setup using https://yourappid.appspot.com/admin

What I want to do is to retrieve data based on date parameters. To do this, we need to pass start_date and end_date parameters to the url. However, the current version of superProxy does not support this feature. As a company, what we want to do is to select the related dates as it is in Google Analytics itself and retrieve the data in real time by using superProxy.

For example it would be great if we would have this option in the url:

var url = "https://yourappid.appspot.com/query?id=ahVzfmFuYWx5dGljc2FwcDRhY3hpb21yFQsSCEFwaVF1ZXJ5GICAgICA8ogKDA&format=json&start_date=10-14-2013&end_date=10-16-2013";

This means the superProxy Python source codes need to be changed accordingly. We need your help with this change.

Fatih Sen

unread,
Oct 21, 2013, 10:35:23 AM10/21/13
to google-analyti...@googlegroups.com
Would be glad if anyone could help with that.

Pete

unread,
Oct 25, 2013, 1:28:43 PM10/25/13
to google-analyti...@googlegroups.com
This is a significant change and opens up the proxy to dynamic queries. Anything is possible but unless someone else wants to write this functionality or there is more demand for this it won't happen for awhile. Also, you'd be ok with the possibility that anyone could take an existing query that you have created and query for any date?

If you're using Google Apps Scripts, have you had a look at https://developers.google.com/analytics/solutions/report-automation-magic

nikolas anova

unread,
Apr 8, 2014, 5:34:15 AM4/8/14
to google-analyti...@googlegroups.com
I too very need for this function.
I need your help with this change in code.
Thanks.


Karl Equi

unread,
Oct 20, 2014, 7:18:06 AM10/20/14
to google-analyti...@googlegroups.com, fati...@acxiom.com

Would be a nice feature - although you would need to be able to open up the dynamic bit to just certain metrics / dimensions.

I can see how that would be a pretty big change however!
Reply all
Reply to author
Forward
0 new messages