Hi,

How i can extract the report using the google analystic reporting module at a particular date range
Note: Need the calender to select the date range

How i can acheive that , is this required any knid of code modificaion?

Thanks,
KumarE

Comments

grendzy’s picture

Category:bug» support
Priority:Critical» Normal
kumarE’s picture

Any idea how to proceed on this?
Thanks,
Srinil

mmenavas’s picture

In case anyone is still trying to implement this feature, this is how I did it.

0. Install and enable the Better Formats module (https://drupal.org/project/better_formats).
1. Add 'Google Analytics: Start/End' filter, expose filter, select 'Is Between' as the operator, and select 'A date in any machine...' as the value type.
2. Under Advanced > Exposed Form, change the 'Exposed form style' from 'Basic' to 'Better Exposed Filters'. Then on 'BEF Settings' look for the option 'Display "start_end" exposed filter as' and select JQuery UI Datepicker.

3. Modify the code on google_analytics_views/handlers/google_analytics_handler_filter_startend.inc

from

<?php
 
function op_between($field) {
   
$a = REQUEST_TIME + intval(strtotime($this->value['min'], 0));
   
$b = REQUEST_TIME + intval(strtotime($this->value['max'], 0));
   
$operator = strtoupper($this->operator);
   
$this->query->add_where($this->options['group'], 'end_date', $a);
   
$this->query->add_where($this->options['group'], 'start_date', $b);
  }
?>

to

<?php
 
function op_between($field) {
   
$operator = strtoupper($this->operator);
   
$this->query->add_where($this->options['group'], 'start_date', strtotime($this->value['min']));
   
$this->query->add_where($this->options['group'], 'end_date', strtotime($this->value['max']));
  }
?>

That should be it.

mmenavas’s picture

Issue summary:View changes

updated text

cthshabel’s picture

Issue summary:View changes

mmenavas,

thanks for sharing your solution. this seemed simple enough but digging in it seems things have changed a lot in this module since this version.

i notice there are more options available now for the start and end date filters.

can someone explain or direct me to more information on how to allow users to select the dates via a calendar?

thanks everyone