How to set up Google Analytics asynchronous tracking in DotNetNuke (the ‘new’ version of the GA tracking code)

The open source DotNetNuke content management system is hugely versatile and pretty powerful. If you haven’t used it before, (unsurprisingly) it’s written in .net and has a raft of third party modules to enhance it’s functionality, many of which are superb.

I encountered a problem recently though. While DNN has a built in ‘Google Analytics’ Admin module that allows you to add GA tracking to every page, it adds the code in the traditional tracking format, which has since been superceded by the superior asynchronous tracking.

The traditional code looks like this:

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try{
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._trackPageview();
} catch(err) {}</script>

Whereas the newer asynchronous code looks like this:

<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>

Quite a difference, no?

On top of all this, the asynchronous code should sit just before the </head> tag, whereas the traditional code (and thus the DNN Admin function) sits it just before the </body> tag.

To set up asynchronous tracking on DotNetNuke, we need to make some changes to the SiteAnalytics.config file that is located in the root of your DNN installation (goes without saying but always take backups of any files you are making significant changes to).

  1. Open SiteAnalytics.config (located in the root of your DotNetNuke installation. It will look something like the below (the parts we will need to change are highlighted in red, green and amber):
  2. <?xml version="1.0" encoding="utf-8" ?>
    <AnalyticsEngineConfig>
    <Engines>
    <AnalyticsEngine>
    <EngineType>DotNetNuke.Services.Analytics.GoogleAnalyticsEngine, DotNetNuke</EngineType>
    <ElementId>Body</ElementId>
    <InjectTop>False</InjectTop>
    <ScriptTemplate>
    <![CDATA[
    <script type=”text/javascript”>

    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    try{
    var pageTracker = _gat._getTracker("[TRACKING CODE]");
    pageTracker._trackPageview();
    } catch(err) {}</script>

    ]]>
    </ScriptTemplate>
    </AnalyticsEngine>
    </Engines>
    </AnalyticsEngineConfig>


  3. Change the Element ID (highlighed in red) to ‘Head’ and the analytics tracking code (highlighted in green) to the asynchronous Google Analytics tracking code, replacing “[TRACKING CODE]” (highlighted in amber) to your website’s individual tracking ID, in the format ‘UA-XXXXX-X’. Note that asynchronous tracking uses ‘ around the code instead of “.
  4. Your SiteAnalytics config file should look something like the below:
  5. <?xml version="1.0" encoding="utf-8" ?>
    <AnalyticsEngineConfig>
    <Engines>
    <AnalyticsEngine>
    <EngineType>DotNetNuke.Services.Analytics.GoogleAnalyticsEngine, DotNetNuke</EngineType>
    <ElementId>Head</ElementId>
    <InjectTop>False</InjectTop>
    <ScriptTemplate>
    <![CDATA[

    <script type="text/javascript">

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-XXXXX-X']);
    _gaq.push(['_trackPageview']);

    (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();

    </script>]]>
    </ScriptTemplate>
    </AnalyticsEngine>
    </Engines>
    </AnalyticsEngineConfig>

  6. Now log in to your Admin control panel on DotNetNuke and navigate to the Google Analytics module. Enter your GA tracking ID and click update. (Note: entering your GA tracking ID here is required to trigger the module to add to every page: because we’ve hard coded the SiteAnalytics.config file with your GA tracking ID already, it isn’t populating it with the value you are entering on the GA module page. Not ideal I know, but it works perfectly none the less.)
  7. Hey presto! You now have Google Analytics asynchronous tracking on your DotNetNuke website.

It’s important to note that if you re-install DotNetNuke, you will have to update the SiteAnalytics.config file, as it will be restored to it’s default otherwise.

One quick note: I’ve not tested this thoroughly, but it looks as though Google Analytics tracks visits even when you are logged in as Admin. There’s a simple fix to this: log in to your Google Analytics account, choose your website profile, click ‘edit’ and add a filter to exclude all traffic containing the subdomain /Admin/


Channel 4 bids on ‘Richard Keys’ as a PPC term to promote the 10 o’clock show

In the wake of Sky sacking Andy Gray, all attention has turned to Richard Keys. Will he get the chop or just get a slap on the wrists?

Whatever the case, his name has been trending for the last few days, and Channel 4 has taken advantage of his new-found popularity (or should that be unpopularity?) by bidding on the keyword term ‘Richard Keys’ and displaying an ad for the 10 o’clock show.

The ad, which sports the cheeky tag line ‘Making politics as clear as Andy Gray’s diary’ (I like it!) has been running throughout today.

Is this a good move by C4, and should all advertisers think about bidding for trending terms that aren’t the least bit relevant to whatever their ad’s about?

From a brand perspective, it’s gaining serious exposure for the 10 o’clock show. But what about C4’s quality score? I can’t see many people clicking the ad after having a chuckle at it, but given C4’s spend on PPC, I think they’ll be happy to take a tiny dent on their QS for the sake of the brand exposure on this one.

I doubt a small business would fare well by bidding on such a term though. Or is it just me? Leave a comment below if you have experience of bidding on trending topics and how it worked out for you and your QS.


8 things that are losing you money from your e-commerce site

It’s crucial not to lose sight of what an e-commerce website is there to do: sell products.

Too many sites get caught up in fancy flash or javascript animations that add nothing to the user experience and, at the other end of the spectrum, a lot of online shops are using dated designs. It’s a tricky balancing act, but with a few simple tweaks you could dramatically improve conversions.

This is my list of 8 important factors that are costing your e-commerce site money. If I’ve missed any off, leave a comment below.

1. No clear call to action

The call to action is without a doubt the most important thing on the page; it’s ultimately what you want the user to do. Make sure you choose a colour that stands out (it doesn’t have to be painfully bright, it just needs to contrast against the rest of the page) and keep it simple.

The best way to know whether you have an effective CTA is to imagine your page with a sheet of tracing paper over it – you should still be able to see your CTA, just from it’s prominence. Take a look at eBuyer – even with this much blurring, you can see how to buy the product:

If you sell products, think about taking the user to a summary of their basket immediately after adding the item. How many times have you added something to your basket, only to subsequently have to click the Basket link and proceed to buy? If you take the user straight to a Basket summary, it saves them a click.

2. Not displaying a phone number

Always be open with a contact number. I don’t mean plastering it all over the site – in fact, I would advise against this, as you could be pushing sales off the online channel and to the phone. But place it clearly on your contact us page so if customers want to call you, they can.

If you don’t want to display a phone number for whatever reason, use a service like LivePerson to offer an online chat facility. In my experience, if people have taken the time to visit your site, they are more likely to use an online chat service to get a question answered than go offline and make a phone call.

O2 cleverly display their chat box in a lightbox when you visit the ‘Call us’ page, keeping customers who are just about to go offline online.

3. Long and unnecessary registration pages

Data is great. But why add another step into the checkout process? By placing your registration page after the transaction is done, you can improve conversions and decrease drop outs.

If you absolutely have to collect data before the user pays, only take the information you need. Anything surplus to requirements will make the customer think you will sell their data on and increase the likelihood of them dropping out.

4. Hiding delivery charges until the checkout

Customers don’t tend to be put off by delivery charges, but they are put off when all of a sudden they appear on the final page of the checkout. If you charge for delivery, be open and transparent about it – hiding it until checkout in the hope the user won’t care is naive. Think about offering discounted delivery for larger orders to take the sting out of it.

Without meaning to jump on the anti-H and M bandwagon (their online store seems to have taken a lot of criticism since it’s launch),  they offer no info of the delivery charges on the product page, but £3.95 is added to the final page of the checkout process.

5. Not using a basket abandonment email

It’s an old one, but it does work. Considering 98% of your customers will not buy anything from your site, when you have someone on the hook, don’t let them get away! Experiment by sending basket abandonment emails at different times and see which works best for you. Make sure that the CTA in the email is clear.

6. Placing a back button in the checkout

Think about the last time you went to Amazon – did you see a back button? They use two call to actions to Proceed, but none to go back. This keeps customers in a forward progression towards the final page of the checkout. Instead of using a back button, on the final page before payment display a summary of the customers’ order and place ‘Edit’ buttons alongside each section.

7. Not configuring Google Analytics tracking properly

Any number of things could cause someone to leave your website – but with Google Analytics properly configured, you can take the guesswork out of what your site is doing wrong. Configuring funnels and goals can let you see in great details which pages are deterring visitors from buying. Combine this with your AdWords tracking to work out the ROI of keyword terms.

8. Browser incompatibility

Internet Explorer, Firefox, Chrome and Safari should be treated as a minimum requirement, especially if you are paying for traffic to come to your site through PPC or similar. A lot of figures are batted around for the % penetration of each browser, but if you manage to get these four to work, 95%+ of your visitors should be able to use your site.


Why Quora won’t be bigger than Twitter

There has been a lot of talk lately about Quora, the social media question and answers site.

The concept is simple. Users log on via their Facebook or Twitter account, post a question, and other users answer them. The best answer is then voted ‘up’ by other users. A kind of Yahoo! Answers with a dose of social media.

So, what exactly is the benefit to going to Quora then searching for a question over directly searching a question in a search engine?

To be frank, I don’t see one.

The honeymoon period

Quora is going through a wonderful honeymoon period at the moment – even AOL’s former chairman has been on there answering all kinds of questions about the company. Some of the answers come from apparent experts in the field – CEOs of organisations and experienced Entrepreneurs.

The problem is, it won’t be long before companies start plugging their own products in their answers – and as soon as this happens, the trust between the community and Quora disintegrates. It just becomes another sales platform.

The biggest issue (and one that has plagued Yahoo! Answers for years) will be when the spammers arrive though. You could argue that, as everyone will have to log in using their Facebook or Twitter account, people will be less inclined to spam. This wasn’t the case with Yahoo! Answers, and probably won’t be the case with Quora.

Is Quora doomed from the start?

The problem Quora faces isn’t just to create a spam-free, quality-content rich site – it has to change search behaviour. Internet users are all for speed – look at why Google Instant was introduced – so why waste time going to one website that might have the question you’re looking for when you can aggregate the results with a search engine and be presented with numerous other authority sites that are better qualified to answer you?

Quora might have a place for niche answers – almost long tail terms in search engines – but there is very little distinguishing it from Yahoo! Answers, which is why it will never be bigger than Twitter.

Does anyone think Quora will succeed?


Can Criteo outsmart the Google Content Network?

You might have noticed that when you go on some sites you’re presented with ads which are surprisingly similar to some of the things you’ve been looking at online. This is no coincidence; two advertising network giants, Criteo and Google, are making use of website visitor’s cookies to deliver more relevant, targeted advertising to the end user.

How does it work?

Criteo’s advertisers place tags in the visitor’s cookie, which states the product they looked at. When the user leaves the advertisers site and visits a publisher’s site, the publisher’s site picks up this information from the cookie and displays targeted advertising based on the information from the visitor’s cookie.

Here’s an example from Criteo’s network – let’s say you go on Dell’s website, and take a look at their Inspiron 1018, but decide not to buy it and leave their site.

You then go to a completely different site that happens to be a member of the Criteo network, and lo and behold in front of you, there is an ad for the same laptop you were looking at, along a couple of other products that may other customers went on to buy if they decided against the Inspiron 1018.

Google, on the other hand, is slightly less sophisticated. Their remarketing ads are displayed in their AdSense units, so they don’t always display the actual product you previously viewed (or any alternatives) like Criteo does.

Can Criteo outsmart the Google Content Network?

While Criteo’s reach (20m UK consumers as of December 2010) is a serious amount, in order to compete with Google’s mammoth content network, they need a competitive edge.

When it comes to tangible products, Criteo could take a serious slice of the online advertising market. Displaying tailored ad units, including an image of the view product and alternatives (as above) is going to have a much better conversion rate than displaying a generic Dell advert.

With regard to services though, like banking or insurance, Google will rule supreme. How could Criteo display a new bank account or car insurance policy better than Google’s current AdSense units? These kind of ads depend on reach, something that Criteo just can’t compete with at the moment.

Could Criteo one day overtake the Content Network? Let me know what you think below.