Analytics
3K members online now
3K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Real time not working correctly

Follower ✭ ☆ ☆
# 1
Follower ✭ ☆ ☆

Hi There, I have tracking code on a new site for a client. We are tracking downloads as well as page views.

I am using the exact same code on this new website that is working on one of my other sites but this new site is not showing any data in realtime when anyone is browsing.

The website is skillsiq.com.au

 

The code below is the same as another of one my sites (except changed UA number). The below doesn't show realtime.

Any ideas why?

 

<script>
(function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’);

ga(‘create’, ‘UA-78963724-1’, ‘auto’);
ga(‘send’, ‘pageview’);

$(document).ready(function () {
$(“a[href$=’.pdf’], a[href$=’.doc’], a[href$=’.docx’], a[href$=’.xls’]”).on(‘click’, function() {
ga(‘send’, ‘event’, $(this).attr(‘href’), ‘click’, $(this).attr(‘href’));
});
});

</script>

 

Thanks TR

1 Expert replyverified_user
Marked as Best Answer.
Solution
Accepted by topic author PDQ D
July 2016

Re: Real time not working correctly

[ Edited ]
Top Contributor
# 2
Top Contributor

Hi :-)
There are errors in the tracking code snippet. The single and double quote characters,
are being inserted like characters from a word processed document rather than as code characters

  

I checked the code from your post against the code on the site and this is the case in both instances.

 

Make sure if you need to copy the code from elsewhere and save it before adding it to the site code, that you copy it to a plain text document such as notepad, so as the code characters do not get altered

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Re: Real time not working correctly

Follower ✭ ☆ ☆
# 3
Follower ✭ ☆ ☆
Hi Bronwyn,

thanks for getting back to me. I will have a look at this now and see if I can fix this. I really appreciate it.

Re: Real time not working correctly

Follower ✭ ☆ ☆
# 4
Follower ✭ ☆ ☆
All fixed. thanks for you quick reply.

Re: Real time not working correctly

Top Contributor
# 5
Top Contributor
Happy to hear you have resolved the issue

Cheers
Bronwyn :-)
Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here