Support » Plugin: Reduce Bounce Rate » Js error

  • Hi,

    When i activate the scroll options i get the error

    analyticsjs.js?ver=4.8.3:1 Uncaught TypeError: $ is not a function
    at analyticsjs.js?ver=4.8.3:1

    Can you please take a look, without the scroll active by bounce rate will not go down.
    No i have the scroll option inactive so its not giving the error.

    Thanks,

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Okoth1

    (@okoth1)

    Hi,

    There is one part of the plugin code I cannot find back on your website. Normally it is on the homepage, but you minify js. It’s this part, maybe you could try and find it?

    var trackScrolling=false;var trackScrollingPercentage=true;var ScrollingPercentageNumber=25;var stLogInterval=10*1000;var cutOffTime=900;var trackNoEvents=false;var trackNoMaxTime=false;

    Does the plugin work when you don’t minify the code?

    I remove the minify, add the scroller option and it is giving the same error.
    That code you ask for in on the page now.
    You can check.

    If i remove the scroller options its working fine.

    I just fixe it.
    Change the code from your analytics.js and replace the $ for jQuery in the last function, it was where was giving the error.

    All is working fine now. Can you check please ?

    jQuery(document).scroll(function(a) {
    for (iz = 0; iz < ScrollMatrix.length; iz++) {
    if ((jQuery(window).scrollTop() + jQuery(window).height() >= jQuery(document).height() * ScrollMatrix[iz][0] / 100) && (ScrollMatrix[iz][1] == “false”)) {
    ScrollMatrix[iz][1] = “true”;
    ga(“send”, “event”, “Percentage Page Scroll”, window.docTitle, ScrollMatrix[iz][0] + “%”, {
    nonInteraction: EventNONInteraction
    })
    }
    }
    })

    • This reply was modified 11 months, 1 week ago by  sarags.
    Plugin Author Okoth1

    (@okoth1)

    Yes, I don’t see any errors now. But you haven’t enabled the scrolling tracking, right?

    BTW I tried to find the fix for this. It’s somewhere in a reply before but I can’t find it right now. In the past I used your option, but then it had conflicts with an other plugin, so I changed it back. I believe it was MonsterInsights. As long as you don’t use that, it’s OK.

    • This reply was modified 11 months, 1 week ago by  Okoth1.
    sarags

    (@sarags)

    Hi, I have enable the scrolling and it working fine because i changed your plugin code.

    I edit the analytics.js in the plugin and replace the “$” for “jQuery” in the last function, it was where was giving the error.

    • This reply was modified 11 months ago by  sarags.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Js error’ is closed to new replies.