Where Do I Place Google Analytics Code Inside a .ASPX Page?

What are appropriate ways to use page-level custom variables in Google Analytics?

  • I am trying to compare page-level custom variable and session level custom variable. here is my case: I embed the track code into 2 pages in my site : _gaq.push(['_setCustomVar', 1, 'page', 'p1', 3]); _gaq.push(['_setCustomVar', 2, 'session', 'p1', 2]); before _trackpageview in page index1.html _gaq.push(['_setCustomVar', 1, 'page', 'p2', 3]); _gaq.push(['_setCustomVar', 2, 'session', 'p2', 2]);  before _trackpageview in page index2.html after 10 visits to this site, in the GA reports I saw: custom variable -> slot1-> page p1 : visits 9 p2 : visits 1 custom variable -> slot2-> session p1 : visits 7 p2 : visits 3 it mean session-level custom var segments 10 visits into 3+7 while page-level custom var segments 10 visit into 1+9; where is this difference comes from? (I only embed the track code on these 2 pages, and the 10 visits are all on these 2 pages)

  • Answer:

    Page-level custom variables Visits has recently been renamed to Visits Starts to clarify things when dealing with page-level custom variables. Visits in "page-level world" is the same as which page-level custom variables were present on a landing page. The equivalent would be to look at Visits in the Landing Page report. In your example, 9 visits started with page: p1, and 1 visit started with page: p2. Session-level custom variables It is always the last call within its scope that is logged. If you in the same session try to log the following session: first-page session: second-page session: third-page Your session will get attributed the last call, i.e.: session: third-page. In your example, 7 visits ended on index1.html (session:p1), and 3 visits ended on index2.html (session:p2).

David Andersson at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.