Setting up WordPress. Super-simple-google-analytics and _setDomainName.

So, I use WordPress CMS to run this blog and super-simple-google-analytics plugin to collect some analytics.

And because the plugin is really super simple, it lacks some settings. In my case I want to use a sub-domain feature of Google analytics ‘_setDomainName’ to point Google Analytics to my main website.

My solution is maybe too straightforward, but it is super simple as well, and it works. So, to add a required feature, open the super-simple-google-analytics plugin settings, find line ‘_gaq.push([\’_setAccount\’, \’UA-%1$s-%2$s\’]); ‘ and the following line after it:

_gaq.push([\'_setDomainName\', \'your-domain.com\']);

 

Then click Update File and you’re done!

Oh, yes it works only for asynchronous loading of Google Analytics.

Now some pictures to illustrate this:

1. Link to the plugins page. I use multi-sites configured in my wordpress, but in single-site version it should not be very different:

super-simple-ga-menu

2. In the plugin list find the Super Simple GA plugin and choose to edit it’s code:

super-simple-ga-edit-plugin-link

3. Make the changes:

super-simple-ga-editor