• When we configured Google Tag Manager, we found that the window.onload init script stopped working, as GTM also implements a listener here.

    So, we modified the code starting on line 93 (show_counter.js) and used this pattern. Please incorporate or post feedback at your convenience.
    `[93] window.onload = function() {
    //add countup via eventlistener
    window.addEventListener ?
    window.addEventListener(“load”,add_count_listener(),false):
    window.attachEvent && window.attachEvent(“onload”,add_count_listener());

    function add_count_listener() {
    wpcjs_get_counter();
    wpcjs_check_visibility();
    $( window ).on( ‘scroll’, wpcjs_check_visibility );

  • The topic ‘issue with window.onload for show_counter’ is closed to new replies.