Commit f247909e authored by hass's avatar hass
Browse files

#807320 Rollback: Track outgoing links as targets / Disable event

tracking optionally for outgoing links
parent 343b1b79
......@@ -201,12 +201,6 @@ function googleanalytics_admin_settings_form($form_state) {
'#description' => t('A file extension list separated by the | character that will be tracked as download when clicked. Regular expressions are supported. For example: !extensions', array('!extensions' => GOOGLEANALYTICS_TRACKFILES_EXTENSIONS)),
'#maxlength' => 255,
);
$form['tracking']['linktracking']['googleanalytics_trackoutboundaspageview'] = array(
'#type' => 'checkbox',
'#title' => t('Track clicks on outbound links as page views'),
'#default_value' => variable_get('googleanalytics_trackoutboundaspageview', 0),
'#description' => t('By default outbound links are tracked as <em>Events</em>. In rare situations like tracking of <em>Goals</em> it may be required to track outbound clicks as page views.'),
);
// Google already have many translations, if not - they display a note to change the language.
global $language;
......
......@@ -43,7 +43,6 @@ function googleanalytics_uninstall() {
variable_del('googleanalytics_trackfiles_extensions');
variable_del('googleanalytics_trackmailto');
variable_del('googleanalytics_trackoutbound');
variable_del('googleanalytics_trackoutboundaspageview');
variable_del('googleanalytics_translation_set');
variable_del('googleanalytics_visibility_pages');
variable_del('googleanalytics_visibility_roles');
......@@ -414,3 +413,12 @@ function googleanalytics_update_7005() {
return t('Custom path visibility filter setting found. Update skipped!');
}
}
/**
* Delete obsolete trackOutboundAsPageview variable.
*/
function googleanalytics_update_7006() {
variable_del('googleanalytics_trackoutboundaspageview');
return t('Deleted obsolete trackOutboundAsPageview variable.');
}
......@@ -48,11 +48,6 @@ $(document).ready(function() {
// Top-level cross domain clicked. document.location is handled by _link internally.
_gaq.push(["_link", this.href]);
}
else if (ga.trackOutboundAsPageview) {
// Track all external links as page views after URL cleanup.
// Currently required, if click should be tracked as goal.
_gaq.push(["_trackPageview", '/outbound/' + this.href.replace(/^(https?|ftp|news|nntp|telnet|irc|ssh|sftp|webcal):\/\//i, '').split('/').join('--')]);
}
else {
// External link clicked.
_gaq.push(["_trackEvent", "Outbound links", "Click", this.href]);
......
......@@ -113,9 +113,6 @@ function googleanalytics_page_alter(&$page) {
$link_settings['trackDownload'] = $track_download;
$link_settings['trackDownloadExtensions'] = $trackfiles_extensions;
}
if ($track_outbound_as_pageview = variable_get('googleanalytics_trackoutboundaspageview', 0)) {
$link_settings['trackOutboundAsPageview'] = $track_outbound_as_pageview;
}
if ($track_domain_mode = variable_get('googleanalytics_domain_mode', 0)) {
$link_settings['trackDomainMode'] = $track_domain_mode;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment