AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
2.5K members online now
2.5K 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

Not showing real time active users---tracking code placed correctly...I think.

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Not showing real time active users---tracking code placed correctly...I think.

 

I have the website up on my desktop and Kindle... 

 

www.elleauteur.com

 

<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', 'https://www.google-analytics.com/analytics.js', 'ga');

ga('create', 'UA-62507525-2', 'auto');
ga('set', { page: '/index', title: 'Home' });
</script>

 

Similar code has worked before for www.redcarsoft.com... now up on my desktop and mobile phone.  This has worked before...

 

thanks in advance,

 

Johnny

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Johnny C
March 2017

Re: Not showing real time active users---tracking code placed correctly...I think.

Follower ✭ ✭ ✭
# 2
Follower ✭ ✭ ✭

Hi Johnny C

 

The code is not send to Google Analytics.

Please try following code.

 

<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', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-62507525-2', 'auto');
ga('set', { page: '/index', title: 'Home' });
ga('send', 'pageview');  // Add
</script>

 

Thanks

 

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Johnny C
March 2017

Re: Not showing real time active users---tracking code placed correctly...I think.

Follower ✭ ✭ ✭
# 2
Follower ✭ ✭ ✭

Hi Johnny C

 

The code is not send to Google Analytics.

Please try following code.

 

<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', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-62507525-2', 'auto');
ga('set', { page: '/index', title: 'Home' });
ga('send', 'pageview');  // Add
</script>

 

Thanks

 

Not showing real time active users---tracking code placed correctly...I think.

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Okay, I made the change. Checking my report now... let's see what turns up!

Not showing real time active users---tracking code placed correctly...I think.

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Ryota,

 

Thank you! That worked!  However, the earlier code used to work but oh well!

 

Thanks again!

 

Johnny

Not showing real time active users---tracking code placed correctly...I think.

Top Contributor
# 5
Top Contributor

Hi :-)
You seem to have possibly resolved the issue since i first looked at the page

the last line of the tracking code was missing

ga('send', 'pageview');

so no pageview was being sent 

https://developers.google.com/analytics/devguides/collection/analyticsjs/command-queue-reference#sen...

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