Google Analytics - Same URL mapped to two pages - google-analytics

I have my application configured with google analystics. Its a e-learning application in which i have students and instructors.
I want to analysze the home page clicks for both student and instructor. The problem is the home page for student is also available in instructor but as some other page means same URL but different locations.
Now, i have added the script in ONLY student's page. By doing this though i have mapped the URL for an instructor page as well, will that effect the analysis? Will the data collected for students home page be affected by click on same link for instructor ?

If you have a single page that both students and instructors go to, then yes, your data will all show up under the same URL, and you will not be able to tell which views are from students and which are from instructors.
If you have the code ONLY populating when a student is on the page, then yes, this will affect your reports. You will be able to see how many students are viewing the page, but you will not know anything about the instructors viewing the page.
There are 2 things you can do with the GA code to get your numbers:
1) Report a different URL or page name depending on who is viewing. By default, GA reports the URL as the page name, but there is an optional 2nd argument to the _trackPageview call on your page that lets you specify what you want the page name to be. This will make your pages reports show two different entries.
2) Populate a custom variable on the page. This will show all traffic to the same page, but you will be able to use the custom variable to see how much of the traffic is from who.

The accepted answer was for the Classic GA snippet. For the latest GA snippet (Universal), you'd want to go with this.
ga('send', 'pageview', {
'page': '/my-overridden-page?id=1',
'title': 'my overridden page'
});
See Overriding Default Values in the GA Docs.

Related

GTM - Virtual page views & Goals

We have a web site that already has GA page tracking and Goals set up to track conversion based on URLs, and these are working fine via GTM & GA.
We want to introduce a new product and track it via a separate goal/funnel.
Problem is the pages stay the same, so there isn't any change in the URL to differentiate when a customer has selected this product.
Our flow is as follows:
/Price
/Up-sell
/Summary
/Payment
/PaymentComplete
The customer selects the product on the Price page.
In order to get the Goals to track for this new product I've created a series of virtual page views that are triggered when the product is clicked and persist on subsequent pages.
So the URLs within GA now look like:
/Virtual/Price
/Virtual/Up-sell
/Virtual/Summary
/Virtual/Payment
/Virtual/PaymentComplete
I can see the page views within GA fine.
When I create a new goal I base it off the /Virtual/ urls.
However, because GA is firing on each page by default I effectively get two URLs in GA the original URL, e.g. /Price AND /Virtual/Price this then causes issues tracking between pages in the funnel & goal.
What am I doing wrong here?
How does everyone else manage this scenario?
You can add exceptions to the GA trigger in GTM, add the URLs that you don’t want. Or, don’t fire the trigger that sends the virtual page.

In Google Analytics, how do I plot on a timeline users who visited one page but not another?

I'm looking for some help creating a Google Analytics report that shows, in a timeline, the number of Users who visited one page (e.g. Checkout page) but NOT another page (e.g. Thank You page), and in that order. This seems like such a simply report to run, but I cannot seem to find the right settings in Google Analytics to pull this together.
What you need is a segment with the following settings:
Include sessions
Page includes /checkout (replace with your checkout URL) AND
Page excludes /thankyou (replace with whatever your thank you page URL is)

Google Analytics referral triggered by a bookmarklet

I have a question regarding Google Analytics and unwanted referral stats generated by a bookmarklet.
I have a web service with GA installed. My users are using a bookmarklet to accomplish a certain task while visiting some other web page. Bookmarklet creates an iframe and opens up a page which is also on my domain and that page contains the same GA code.
For some reason GA sees those web sites (pages that bookmarklet was used on) as referral pages. That creates a problem for me since those pages are not real referrals (no actual links to my site). I have no desire to track pages my users marked with the bookmarklet.
It’s important to mention that bookmarklet page must be a part of the same domain as my main page. I can not move it on other domain or subdomain.
This is what I tried so far:
I’ve created a new GA account (subdomain.mydomain.com) and used it only on my bookmarklet page hoping that all stats related with the bookmarklet will appear on that account. This worked only partially. Stats for the bookmarklet started to appear on the new account but my original GA account continued to track referral pages.
We tried to use a pop up window to load a web page instead of the iframe. No difference.
Any help on how to get rid of unwanted referral sites would be appreciated.
See _setReferrerOveride:
_setReferrerOverride()
_setReferrerOverride(newReferrerUrl)
Sets the referrer URL used to determine campaign tracking values. Use this method to allow gadgets within an iFrame to track referrals correctly. By default, campaign tracking uses the document.referrer property to determine the referrer URL, which is passed in the utmr parameter of the GIF request. However, you can over-ride this parameter with your own value. For example, if you set the new referrer to http://www.google.com/search?hl=en&q=hats, the campaign cookie stores a new campaign with source=google, medium=organic, and keyword=hats.
_gaq.push(['_setReferrerOverride', 'URL-YOU-WANT-AS-REFERRER']);
Or, you could try
_addIgnoredRef():
_addIgnoredRef()
_addIgnoredRef(newIgnoredReferrer)
Excludes a source as a referring site. Use this option when you want to set certain referring links as direct traffic, rather than as referring sites. For example, your company might own another domain that you want to track as direct traffic so that it does not show up on the "Referring Sites" reports. Requests from excluded referrals are still counted in your overall page view count.
Async Snippet (recommended)
_gaq.push(['_addIgnoredRef', 'www.sister-site.com']);
You would have to grab the referrer and populate it dynamically. Probably with parent.document.referrer Of course this might make any referrals (non-bookmarklet) from these sites not record in the future. And, at some point you would need to clear them.
The most simple solution, if you don't need to track the hits from the bookmarklet at all, is to simply not include the GA code in the web page when it is opened by the bookmarklet.
Your bookmarklet can open the page like http://yoursite.com/?mode=bookmarklet
And in your server side code you can use something like
if ( mode != "bookmarklet" ) {
outputGaCode()
}

Multiple links pointing to the same location. Track which one was clicked using Google Analytics

I'm trying to get Google Analytics to track the specific link in the page that was used by the users to get to a specific location.
Say I have links poing to the contact page from the main menu, the page's contents and the footer.
Looking at what other websites are doing, I've added references inside GET parameters for each of the links like so: http://www.example.com/contact?ref=menu , http://www.example.com/contact?ref=content and http://www.example.com/contact?ref=footer . I've also added the ref parameter to the ignore list inside Google Analytics so the three URLs are not tracked as separate pages.
My question now is: How sould I go about tracking which one was used to get to the contact page?
Although the post is a bit old, for others like me finding this via search, here is the solution. Enhanced Link Attribution in Google Analytics.
http://support.google.com/analytics/bin/answer.py?hl=en&answer=2558867
Sounds like you are already tracking them with the URL param.
If Google Analytics is successfully tracking them as separate pageviews with the ref= URL param, then you could create a custom report in GA that shows the number of pageviews. The custom report can be added to your dashboard for quick reference.
The custom report can be set up like this:
Metric groups: pageviews
Dimension drilldowns: page
Filters: include -> Page -> regex -> /contact\?ref=(content|menu|footer)
Or, for each click, add the following to each link:
Contact
Contact
Repeat for each link. This is no more work than adding a ref= to each link.

Google analytics to track impressions/views?

I have a site that lists business listings from a database. On each page you can do different things such as forward it to a friend, print the page etc. My question is could I use google analytics to track impressions and views for each listing? So if I showed the top 10 listings on the home page I want to track each listing as an impression since its being showed, then if they click one of the links to view the business listing it tracks it as a view. Then on the business listing details page if they do any of the actions such as forward to a friend or print the page I want to track that as well.
For tracking views/clicks Im assuming I would need to use setPageView passing something like setPageView('/listing/12345') correct? I dont know how to track it for impressions though. Then on the listing details page to track if they printed it etc Im assuming I would track it as an event? Such as trackEvent('listing', 'Print') if that is what I need to do for event how does it associate with the page tracking so that I could see how many times someone printed the listing page for /listings/12345?
No need to create fake page views. Google Analytics has a feature called Event Tracking, which is described in the Event Tracking Guide. The guide has an illustrative example;
A simple example illustrates how you might use the Event Tracking method
to record user interaction with a video Play link on your page. It
assumes that pageTracker is the name used for your tracking object.
Play
In this scenario, the reports for Events would display Videos as the Category,
Play as the Action, and Baby's First Birthday as the Label.
In your case, you would track Views and Clicks using the Event Tracking feature. You'd have to decide on how you'd want Actions, Categories and Labels set up to match your data. You might want package types (Gold, Silver etc) as Categories or Labels, for example.
This question and its answers are similar to your scenario.

Resources