Index: google_analytics/googleanalytics.admin.inc =================================================================== --- google_analytics/googleanalytics.admin.inc (revision 7699) +++ google_analytics/googleanalytics.admin.inc (working copy) @@ -76,7 +76,7 @@ if ($access) { $options[] = t('Add if the following PHP code returns TRUE (PHP-mode, experts only).'); - $description .= ' '. t('If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can break your Drupal site.', array('%php' => '')); + $description .= ' '. t('If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can break your Drupal site.', array('%php' => '')); } $form['page_vis_settings']['googleanalytics_visibility'] = array( '#type' => 'radios', @@ -341,6 +341,13 @@ '#default_value' => variable_get('googleanalytics_trackadsense', FALSE), ); + $form['advanced']['googleanalytics_doubleclick'] = array( + '#type' => 'checkbox', + '#title' => t('Track Using Doubleclick.net'), + '#description' => t('If checked, use the Doubleclick link to count hits instead of the default google-analytics.com URL.'), + '#default_value' => variable_get('googleanalytics_doubleclick', FALSE), + ); + $form['advanced']['codesnippet'] = array( '#type' => 'fieldset', '#title' => t('Custom JavaScript code'), Index: google_analytics/googleanalytics.module =================================================================== --- google_analytics/googleanalytics.module (revision 7584) +++ google_analytics/googleanalytics.module (working copy) @@ -256,8 +256,12 @@ $script .= 'ga.src = "' . $url . $query_string . '";'; } + else if(variable_get('googleanalytics_doubleclick', FALSE)) { + // use doubleclick.net instead of google-analytics.com + $script .= 'ga.src=("https:"==document.location.protocol?"https://":"http://")+"stats.g.doubleclick.net/dc.js";'; + } else { - $script .= 'ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";'; + $script .= 'ga.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";'; } $script .= 'var s = document.getElementsByTagName("script")[0];'; $script .= 's.parentNode.insertBefore(ga, s);'; Index: google_analytics/googleanalytics.install =================================================================== --- google_analytics/googleanalytics.install (revision 7584) +++ google_analytics/googleanalytics.install (working copy) @@ -20,6 +20,7 @@ variable_del('googleanalytics_last_cache'); variable_del('googleanalytics_site_search'); variable_del('googleanalytics_trackadsense'); + variable_del('googleanalytics_doubleclick'); variable_del('googleanalytics_js_scope'); variable_del('googleanalytics_custom'); variable_del('googleanalytics_roles');