× Got a question about SEO, marketing or promoting online? Ask here!

Script to improve Visit Duration reporting in Google Analytics

6 years 3 months ago #345 by adam.bennett
Found this little gold nugget the other day and thought I'd share

Add this script right before the
</body>
tag in your sites html

What is does is it 'pings' google every 10 seconds that a visitor is on your page to let google know that someone is still there. If a visitor doesn't click to view another page, google automatically counts that as an exit after a short amount of time. Our visitors tend to spend a LOT of time in the designer trying to accomplish what they're after. This is very valuable in the instance that someone get and email from your site with a link to the designer. If they open that link and stay in the designer for over 2 minutes without clicking to view another page, google will view that as a bounce. Not with this script though :)

Google looks at your average visit duration and bounce rate as factors for your Ranking in search results- you might as well get credit for every SECOND that a user is on your site :)


Script:
<script type="text/javascript">
(function (tos) {
  window.setInterval(function () {
    tos = (function (t) {
      return t[0] == 50 ? (parseInt(t[1]) + 1) + ':00' : (t[1] || '0') + ':' + (parseInt(t[0]) + 10);
    })(tos.split(':').reverse());
    window.pageTracker ? pageTracker._trackEvent('Time', 'Log', tos) : _gaq.push(['_trackEvent', 'Time', 'Log', tos]);
  }, 10000);
})('00');
</script>

Happy Selling :)

Adam
The following user(s) said Thank You: Vito, Hipbone

Please Log in or Create an account to join the conversation.

6 years 3 months ago #358 by StitchPrint
This seems to be a fantastic post! No offence to Adam but can someone from deconetwork verify it?

Please Log in or Create an account to join the conversation.

6 years 2 months ago #371 by brenden
Hi there,

Why we can't vouch 100% for scripts created by others there does seem to be multiple posts on the web about this script so seems OK.

Let us know your results form using it.


Brenden

Cheers,

Senior Product Manager
Wilcom - Sydney, Australia

File Attachment:


Please Log in or Create an account to join the conversation.

6 years 2 months ago #427 by adam.bennett
We've seen our bounce rates in GA fall from near 40% to 10%-15% since installing this script

Please Log in or Create an account to join the conversation.

5 years 3 months ago #6083 by mjfox
Where in Deco do you add this script?

Please Log in or Create an account to join the conversation.

5 years 3 months ago #6097 by adam.bennett
I added it right before the closing
</body>
tag

Please Log in or Create an account to join the conversation.

5 years 3 months ago #6489 by zhenjie
Thanks Adam going to this out this week. Lower bounce rate = better rankings too!

Tee Junction - Custom T-Shirt Printing in Australia. Outsource your DTG printing to Tee Junction!

Please Log in or Create an account to join the conversation.

2 months 3 weeks ago #22137 by DigiTees
Just randomly stumbled on this while looking for something else - does anyone know if this is still valid?

Please Log in or Create an account to join the conversation.

Time to create page: 0.190 seconds
Powered by Kunena Forum