How to track distinct pageviews on ASP.NET postbacks in Google Analytics

帅比萌擦擦* 提交于 2019-12-12 05:51:50

问题


The typical situation I'm dealing with is an ASP.NET form page (generally an opt-in or sign-up form) that posts back to itself when the user hits submit. By default, Google Analytics will track both of these views as the same page, so it's not possible to detect which visits are the initial view vs. which are the "success" view.

In the past, I've dealt with this in one of two ways:

  1. Using Event Tracking to track form submission as an event. This works fine, but in GA you don't see this metric in the same place as you see the initial page views.
  2. Dynamically adding a querystring to the form's action attribute so the resulting pageview actually shows up as a different page in GA. This feels like a hack, but I like the way the data shows up in GA.

Is either of these approaches preferable, or is there a better way to do it that I haven't thought of?


回答1:


Have a look at virtual pageviews, using them you can make GA think of any event like it was a pageview with the URL you specify.



来源:https://stackoverflow.com/questions/8127634/how-to-track-distinct-pageviews-on-asp-net-postbacks-in-google-analytics

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