Support » Plugin: Ajax Pagination and Infinite Scroll » Google Analytics Code?

  • Resolved heathriel

    (@heathriel)


    This is working great – although I’d love to get my Google Analytics code to track each new post/page load.

    I tried entering the script as a callback, but I’m sure I’m missing something.

    Can you assist?

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

    (@malinkymedia)

    Hi, sorry for the delay in this. Add this to your callback. This will trigger a new page view of th current page when a set of posts is loaded.

    Thanks

    ga(‘send’, ‘pageview’, location.pathname);

    What would be the Callback right code in combination with masonry/isotope?

    This code cause some issues at my layout:

    $(‘.grid-blog-list’).isotope(‘reloadItems’).isotope();
    ga(‘send’, ‘pageview’, location.pathname);

    • This reply was modified 9 months, 2 weeks ago by  js100.
    Plugin Author malinkymedia

    (@malinkymedia)

    Hi, Can you post a link to your site. The isotope code looks correct. If you don’t have fixed heights on your items then you’ll need to wait until images before laying out the new posts. Also are you using isotope or masonry as the callbacks are slightly different too.

    There’s some more information on this https://wordpress.org/support/topic/plugin-breaks-masonry-style/ which covers masonry and imagesloaded.

    Also as mentioned if you can post a link I can take a look.

    Thanks

    I found the problem: the single quote.
    Doing copy-paste of code from this page, the single quote seems not to be well written and in the callback javascript output the single quotes seems badly written.

    Thank you for your help. It works well. 😉

    Plugin Author malinkymedia

    (@malinkymedia)

    Great glad you’ve got things working.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Google Analytics Code?’ is closed to new replies.