Creating a New Custom Object/ Retrieving additional Data

37 views
Skip to first unread message

Michael Gardner

unread,
Nov 7, 2011, 1:49:49 PM11/7/11
to Force.com Toolkit For Google Analytics
Hi,

We were looking to retrieve data for total number of PageViews within
a certain date range (i.e. 11/10/10-11/10/11).

How would we go about adding this/ creating this functionality?

Thanks in advance for your help.

Best,

-Mike Gardner

Shashidhar Gurumurthy

unread,
Nov 8, 2011, 6:55:36 AM11/8/11
to forcecom-toolkit-f...@googlegroups.com
Hi Mike, 

The class GoogleAnalytics.cls has the method public list<Entry> getEntries(Date startDate, Date endDate, list<string> dimensions, list<string> metrics) which allows you to get a metric within a particular date range. You would use the metric ga:pageviews. For more details see the Google Analytics API page: http://code.google.com/apis/analytics/docs/gdata/gdataReferenceDataFeed.html.

Regards, 
Shashi

Michael Gardner

unread,
Nov 17, 2011, 10:53:21 AM11/17/11
to Force.com Toolkit For Google Analytics
Hi Shahsi,

We already included the "ga:pageviews" in the custom field "Metric."
What we are trying to accomplish is to have that appear as a checkbox
within the "Manage Site Settings" setup. How would we go about
creating this and having it appear within the "Edit/ New" function?

Thank you in advance,

-Mike Gardner

On Nov 8, 6:55 am, Shashidhar Gurumurthy
<shashidhar.gurumur...@gmail.com> wrote:
> Hi Mike,
>
> The class GoogleAnalytics.cls has the method public list<Entry>
> getEntries(Date startDate, Date endDate, list<string> dimensions,
> list<string> metrics) which allows you to get a metric within a particular
> date range. You would use the metric ga:pageviews. For more details see the
> Google Analytics API page:http://code.google.com/apis/analytics/docs/gdata/gdataReferenceDataFe...
> .
>
> Regards,
> Shashi
>
> On Tue, Nov 8, 2011 at 12:19 AM, Michael Gardner <
>
>
>
> michael.gard...@usablenet.com> wrote:
> > Hi,
>
> > We were looking to retrieve data for total number of PageViews within
> > a certain date range (i.e. 11/10/10-11/10/11).
>
> > How would we go about adding this/ creating this functionality?
>
> > Thanks in advance for your help.
>
> > Best,
>
> > -Mike Gardner- Hide quoted text -
>
> - Show quoted text -

Shashidhar Gurumurthy

unread,
Nov 17, 2011, 1:22:59 PM11/17/11
to forcecom-toolkit-f...@googlegroups.com
Hi Mike, 

Ok. Sorry I did not understand the question properly first time around. Adding a new metric would require changes in a few places. Based on a quick check, these will be the following but a full analysis would be required. 
  1. AnalyticsSettingsController class
  2. analyticsSettings page
  3. DataImportWorker.cls
  4. GoogleAnalytics.cls
Essentially we will need to start from DataImportWorker.importData() method and follow the execution trail to check & confirm all affected pieces of code. Just having the new metric shown on the front end visualforce page would not ensure that the data will be imported for the new metric. 

We will also need to change the reports and dashboards to reflect the new data element. 

Maybe Matt could advice on how to handle the feature request. 

Hope this answers your question. Let me know if you need any more information. Thanks.

Regards, 
Shashi
Reply all
Reply to author
Forward
0 new messages