Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
drupal.org
google_analytics
Commits
02440a97
Commit
02440a97
authored
Apr 12, 2013
by
hass
Browse files
* Issue #1968286 by hass: Uninstall of 'googleanalytics_trackmessages'
variable is missing * Windows line feeds removal
parent
6822a4ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
14 deletions
+15
-14
googleanalytics.install
googleanalytics.install
+2
-1
googleanalytics.module
googleanalytics.module
+13
-13
No files found.
googleanalytics.install
View file @
02440a97
...
...
@@ -38,6 +38,7 @@ function googleanalytics_uninstall() {
variable_del
(
'googleanalytics_site_search'
);
variable_del
(
'googleanalytics_trackadsense'
);
// @todo
variable_del
(
'googleanalytics_trackdoubleclick'
);
// @todo
variable_del
(
'googleanalytics_trackmessages'
);
variable_del
(
'googleanalytics_tracker_anonymizeip'
);
variable_del
(
'googleanalytics_trackfiles'
);
variable_del
(
'googleanalytics_trackfiles_extensions'
);
...
...
@@ -46,7 +47,7 @@ function googleanalytics_uninstall() {
variable_del
(
'googleanalytics_translation_set'
);
variable_del
(
'googleanalytics_visibility_pages'
);
variable_del
(
'googleanalytics_visibility_roles'
);
variable_del
(
'googleanalytics_privacy_donottrack'
);
variable_del
(
'googleanalytics_privacy_donottrack'
);
// Remove backup variables if exist. Remove this code in D8.
variable_del
(
'googleanalytics_codesnippet_after_backup_6300'
);
...
...
googleanalytics.module
View file @
02440a97
...
...
@@ -227,10 +227,10 @@ function googleanalytics_page_alter(&$page) {
} */
// Build tracker code.
$script
=
'(function(i,s,o,g,r,a,m){'
;
$script
.
=
'i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){'
;
$script
.
=
'(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),'
;
$script
.
=
'm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)'
;
$script
=
'(function(i,s,o,g,r,a,m){'
;
$script
.
=
'i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){'
;
$script
.
=
'(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),'
;
$script
.
=
'm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)'
;
$script
.
=
'})(window,document,"script",'
;
// Which version of the tracking library should be used?
...
...
@@ -259,8 +259,8 @@ function googleanalytics_page_alter(&$page) {
$script
.
=
'ga("set", "anonymizeIp", 1);'
;
}
// Prepare Adsense tracking.
$googleanalytics_adsense_script
=
'window.google_analytics_uacct = '
.
drupal_json_encode
(
$id
)
.
';'
;
// Prepare Adsense tracking.
$googleanalytics_adsense_script
=
'window.google_analytics_uacct = '
.
drupal_json_encode
(
$id
)
.
';'
;
// Domain tracking type.
global
$cookie_domain
;
...
...
@@ -298,13 +298,13 @@ function googleanalytics_page_alter(&$page) {
}
// @TODO: not available yet, comming soon per Google.
//if (variable_get('googleanalytics_trackadsense', FALSE)) {
// Custom tracking. Prepend before all other JavaScript.
// @TODO: http://support.google.com/adsense/bin/answer.py?answer=98142
// sounds like it could be appended to $script.
//drupal_add_js($googleanalytics_adsense_script, array('type' => 'inline', 'group' => JS_LIBRARY-1));
//}
//if (variable_get('googleanalytics_trackadsense', FALSE)) {
// Custom tracking. Prepend before all other JavaScript.
// @TODO: http://support.google.com/adsense/bin/answer.py?answer=98142
// sounds like it could be appended to $script.
//drupal_add_js($googleanalytics_adsense_script, array('type' => 'inline', 'group' => JS_LIBRARY-1));
//}
drupal_add_js
(
$script
,
array
(
'scope'
=>
$scope
,
'type'
=>
'inline'
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment