Google analytics track exits within a one-page checkout

后端 未结 1 1198
忘了有多久
忘了有多久 2021-01-28 13:57

I\'m using an ecommerce system called NopCommerce that implements a one page checkout system. This page asks users to fill out details like billing address / shipping address et

相关标签:
1条回答
  • 2021-01-28 14:11

    I do not know Nopcommerce, but looking at the demo it seems the individual steps are loaded via ajax using jquery, which means you can use global ajax event handlers to send a virtual pageview for each checkout step:

    $(document).ajaxSuccess(function(event, xhr, settings ) {
      url = settings.url.replace("https://mydomain.com","");
      ga('send', 'pageview', url);
    });
    

    Untested, but I'm using something similar for the magento onepage checkout so I'm certain it will work (maybe needs a little tweaking).

    In the global ajax handler callback settings.url stores the url that has beed called via ajax and since you pass a path to an Analytics virtual pageview, not the full url, you'd need to remove the protocol and host name from settings.url.

    0 讨论(0)
提交回复
热议问题