Google analytics track exits within a one-page checkout

…衆ロ難τιáo~ 提交于 2019-12-02 10:22:09

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!