You are here

function theme_analytics_js in Analytics 7

3 theme calls to theme_analytics_js()
theme_analytics_google_ga_js in analytics_google/analytics_google.theme.inc
theme_analytics_google_universal_js in analytics_google/analytics_google.theme.inc
theme_analytics_piwik_js in analytics_piwik/analytics_piwik.theme.inc

File

./analytics.theme.inc, line 3

Code

function theme_analytics_js(array $variables) {
  if (variable_get('analytics_privacy_dnt', TRUE)) {
    $output = 'if (!Drupal.settings.dnt) {' . "\n";

    //$output .= "alert('TRACKING!');";
    $output .= trim($variables['js']) . "\n}";

    //$output .= "else { alert('NOT TRACKING!'); }";

    //$output .= "console.log(Drupal.settings.dnt);";
    return $output;
  }
  else {
    return $variables['js'];
  }
}