I've recently broken my site up into subdomains and am planning on upgrading Woopra to take advantage of the subdomain tracking. Before I do so, however, I wanted to make sure the Drupal module can handle it since it requires a change to the javascript.

Thanks,

Michelle

Comments

michelle’s picture

Title: Are subdomains supported? » Add subdomain support
Category: support » feature

I upgraded my account and it looks like they're not supported. I don't know javascript but I compared the javascript Woopra provided against the javascript in the module and was able to figure it out. If anyone else needs subdomain support in the mean time, here's the corrected function:

function woopra_footer($main = 0) {
  global $user;
  global $base_url;
  $script = '';
  if (arg(0) != 'admin') {
    if ((_woopra_track($user))) {
      $woopra_js = '//static.woopra.com/js/woopra.v2.js';
      $script .= "<script type=\"text/javascript\" src=\"$woopra_js\"></script>\n";
      $script .= "<script type=\"text/javascript\">\n  woopraTracker.setDomain(\"example.com\");\n</script>\n";
      $script .= "<script type=\"text/javascript\">\n  woopraTracker.track();\n</script>\n";
    }
  }
  return $script;
}

You'll need to change "example.com" up there to your root domain. Ideally this would be a variable set in settings rather than hardcoding it in the module, of course, but this works for now.

Michelle