Home › Forums › WoodMart support forum › scrollToTop button
scrollToTop button
- This topic has 7 replies, 2 voices, and was last updated 4 years ago by Elise Noromit.
-
AuthorPosts
-
December 11, 2020 at 1:58 pm #250037
InzmanParticipantHi.
I want to track “scrollToTop” button on click, but it is “return false”. How can I track it with GA?
Thanks.December 11, 2020 at 3:34 pm #250089
Elise NoromitMemberHello,
Please deactivate all the plugins not related to the theme and switch the parent theme, check the issue, If the problem has gone, activate the plugins one by one, checking the issue to detect which one causes the problem.
if the problem remains, provide your site admin access to the private area.
Best Regards
December 14, 2020 at 8:26 am #250746
InzmanParticipantHello.
$(document).on('click', '.scrollToTop', function(){ console.log('Back to top'); });
So this works for you?
December 14, 2020 at 2:32 pm #250879
Elise NoromitMemberHello,
Please have a look at the site: https://woodmart.xtemos.com/ the top button works on click. It appears when the page is scrolled down to the button and returns the user up on click.
If your button works in a different way, deactivate all the plugins not related to the theme and switch the parent theme, check the issue, If the problem has gone, activate the plugins one by one, checking the issue to detect which one causes the problem.
Or clarify your purpose.
Best Regards
December 14, 2020 at 2:42 pm #250886
InzmanParticipantYes, I understand it does what it is supposed to do.
But I also need to add an extra action to it, but in code, there is “return false” and I can’t add the extra event. And I don’t understand why “return false” is needed in your JS.
I want to track whether visitors are actually using this button or is it just wasting viewport room.$('.scrollToTop').on('click', function () { $('html, body').animate({ scrollTop: 0 }, 800); return false; });
December 15, 2020 at 8:38 am #251058
Elise NoromitMemberHello,
Please add this code to the Theme Settings > Custom JS > On document ready:
jQuery('.scrollToTop').on('click', function(){ console.log('Back to top'); });
Best Regards
December 15, 2020 at 9:29 am #251068
InzmanParticipantAhh, wasn’t aware of this option. Now it works, thank you, problem solved!
December 15, 2020 at 10:34 am #251102
Elise NoromitMemberYou are welcome! If you have any questions please feel free to contact us.
Best Regards
-
AuthorPosts
Tagged: Tracking
- You must be logged in to create new topics. Login / Register