Data Studio
1.6K members online now
1.6K members online now
Ask questions about Data Studio
Guide Me
star_border
Reply

Tracking Page Scroll

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello People, 

 

I want to track the event (scroll down) for my landing page. I have found this code from cutroni's blog. Since, it has many event tracking code I am just confused whether I have taken the right code or not. 

The code I have taken is below:

 

// Track the scrolling and track location
$(window).scroll(function() {
if (timer) {
clearTimeout(timer);
}
// Use a buffer so we don't call trackLocation too often.
timer = setTimeout(trackLocation, callBackTime);
});

 

If it is right where it should be placed? If it is wrong, what is the right tracking code(script) Your help in this regard is greatly appreciated.  

Re: Tracking Page Scroll

Explorer ✭ ✭ ✭
# 2
Explorer ✭ ✭ ✭
Hi
You may want to try using this scroll tracking library which is a bit more recent and fully featured.
Full instructions can be seen here http://scrolldepth.parsnip.io/

Re: Tracking Page Scroll

[ Edited ]
Participant ✭ ✭ ✭
# 3
Participant ✭ ✭ ✭

Hi Ashokkumar,

Norman gave a really good advice. http://scrolldepth.parsnip.io/ works well.

There are a couple of great articles and videos out there that you should read/watch about scroll-tracking as well before you start implementing it:

1) If you're using GTM - http://www.lunametrics.com/blog/2016/04/25/scroll-tracking-implement/
2) Julian has created a video that teaches how to implement it as well with GTM: https://www.youtube.com/watch?v=UoOh58pvqG4
3) https://www.optimizesmart.com/implementing-scroll-tracking-via-google-tag-manager/

Hope that it helps.
Taavi

Re: Tracking Page Scroll

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭
Hello Taavi,

Please read my question again. I am not asked for implementing it from Google Tag Manager but by using JavaScript code.

Thanks!

Re: Tracking Page Scroll

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
Hello Noman,

Read my question again. I asked my code is correct or not. I just need JavaScript code for implementing scroll tracking for my landing page.

Hope you understood!

Thanks.

Re: Tracking Page Scroll

Participant ✭ ✭ ✭
# 6
Participant ✭ ✭ ✭
Hi Ashokkumar,

We recommended GTM because it's technically easier to implement scroll tracking through that. Smiley Happy

Read this article: https://www.e-nor.com/blog/google-analytics/measuring-page-scroll-in-universal-analytics
There you can find a code and instructions how to implement scroll-tracking without the GTM.

Hope this helps.
Taavi

Tracking Page Scroll

Follower ✭ ✭ ✭
# 7
Follower ✭ ✭ ✭

Wouldnt that break the site if you normally dont use GTM to track youre site?

Tracking Page Scroll

Participant ✭ ✭ ✭
# 8
Participant ✭ ✭ ✭

Hi Matthew,

 

If you're not a developer and you don't know what you're doing, there's always a risk to screw up your site. Smiley Happy

 

If you're not familiar with JavaScript, I would recommend contacting your developer.

 

Hope this helps.
Taavi