Google Analytics URL for event tracking - google-analytics

I'm tracking several pages with Google Analytics. Each page uses a custom URL passed to _trackPageView:
_gaq.push(['_trackPageview','/someurl']);
(Our site uses the same URL on every page, so I'm stuck with using a virtual URL to identify every page).
This all works fine, but I'm noticing that the virtual URL isn't being associated with any events I later track on the same pages. The events are recorded just fine, but if I view the Events->Pages section in the standard reports, the page URL shown is the main URL for the site, not my virtual URL. So in my case every event ends up being associated with the same URL for the site, instead of the '/someurl' defined earlier.
I'm not doing anything special with the event tracking code, just the usual _gaq.push( [ "_trackEvent", ... ] );
I have a few user timings, and they are showing the same behaviour.
Does anyone know if I can specify a virtual URL to send along with a event?

Apologies if you've already considered this, but how about you add the virtual url to the event label and distinguish between events on different pages that way?

Related

Universal Analytics and login redirect

As part of user flow on my site, user is redirected to a different domain that is not under my control, where he logs in and is then redirected back to my site.
Google analytics fail to correctly display the user flow, showing the callback URL as a new landing page, which is obviously wrong.
I am considering rewriting referrer on the callback page, but it seems like a very hacky solution to a common problem.
Is there a standard way to connect the flow after a redirect?
You must enter the domain of that site in the Referral exclusions list in the Properties settings.

Can I track multiple pages on the same domain, in a single Google Analytics goal/event?

These are the steps on my site:
Step 1: User enters data in a form and submits it.
Step 2: User is redirected to a Plug n Pay page (which is still on the same domain), where they enter their payment information.
Step 3: User is then redirected to the success page.
I would like to track this process as a single event/goal. From what I have read on other sites, I assume I'll have to use ecommerce feature on Google Analytics.
I guess you need a Funnel: Goal type Destination with steps.
At first you need to set sending of virtual pages for successful form submission and successful payment.
If you want to track transactions, you need to set ecommerce feature.
If you want to measure payment just as fact (without informations about money), you can use event or virtual page.
Virtual page URLs you need to add in Goal settings, and the main field in goal will real URL of your final page (success-page).

Google Analytics Referral Path Empty When Using Campaign URL Builder

A URL was generated using Google Analytic's (GA) URL Builder (https://support.google.com/analytics/answer/1033867?hl=en).
The URL includes the utm_source and other required params for GA.
When clicking on a link with this URL the Referral Path is not available. Instead only the Source shows with an empty Referral Path. The Source is set to the value of utm_source.
However, when visiting the page WITHOUT the custom URL via a link the Referral Path is set correctly.
Why does this happen? How can I fix this?
You cannot fix this. Referral Path is available for referral traffic. If you use campaign parameters you turn your link into campaign traffic (this is obviously some unusal use of the word referrer, but Google is thinking in terms of marketing channels instead of the technical definition).
The way around would probably be a custom dimension that stores the referring url.
First you'd have to create a custom dimension in the property settings - I'd go for session level, since the referrer that brought a visitor to your site does not change during the visit.
Then you check (in the source code of your website) window.document.referrer to see if originates from your own domain (in which case you dismiss it) or from another domain, in which case you set it as a dimenson. Basic example (not production code):
if(window.document.referrer.indexOf('mydomain') == -1) {
ga('set', 'dimension1', window.document.referrer);
}
(meaning: if the name of my domain is not a part of the string that makes up the referrer url; and this would be followed by your usual page tracking).
This will store the referrer regardless and you can select your custom dimension as a second dimension or use it in custom reports (of course for CPC traffic or dispay advertising you will get google.com or the adress of the adserver as referrer which isn't that helpful, but for your use case it should work).

Track Keywords from Google Adwords and GA and store them

I run an adword campaign on google.
Users type in keywords and come to my landing pages via few ad's they see. Now my landing page has some 2 pages. One has informational which brings a user directly to the landing page after ad click - second is a signup form. Now I wish to capture the keywords he has typed in and then come into this form so that we know how users are reacting to our ads and what do they type to get to us.
The complex part is how can we use the GA - API to track this down. Since user will landing on /page and may signup finally from /page1 so we need to store those kewyords from his url (which is done via the Value Track codes in the url) and then store in the cookies so that when he later comes to /page1 and is signing up the same keywords can be passed and stored in the backed?
Is this possible and some can please help with this - where to look for how to accomplish this.
Thanks
I append a code to my ad's URL in AdWords:
www.example.com/?code=some-unique-id
On the landing page I check for the query string parameter, and if found store it in a cookie.
Any subsequent pages can access the cookie, and get the code from the original landing page.
This is only ad-group level, but it's a start.

Global routing parameter in ASP.NET MVC

When a user clicks on a link, I want to log some information. I can't do an AJAX request because if they clicked on a link, the page will unload (since they're going to a new page), and I don't want to force them to stay on the page until a synchronous event finishes.
So one idea I had was to add a parameter to the url. I.e. the urls would be actual/action?actualParams&infoIWantToLog=data. Then I could strip off the info I want to log, log that, and then pass off their URL to the action which they actually wanted to go to. Is this possible to do with MVC routing?
Typically tracking URLs send the user to a specific page (or action, in this case), say, /Track, and then pass the parameters to log (including the URL to send the user to) through the querystring.
For instance, go to Google and search on a term. Right click on a result and copy the URL. Now paste it into Notepad. You'll see that it's not a direct link to the search result, but rather to a Google tracking page. For instance, when I search for asp.net and click on the first result (for www.asp.net), this is the actual URL Google sends me to:
http://www.google.com/url?sa=t&source=web&cd=2&ved=0CDcQFjAB&url=http%3A%2F%2Fwww.asp.net%2Fget-started&rct=j&q=asp.net&ei=BauTTIuCDIaWsgOHgo3ACg&usg=AFQjCNGR6cOBKtUWIKZs9jnpz0vYRDu_EA&sig2=r2q31zniuxHQ4Y6BIoudow&cad=rja
That page logs my click and then redirects me to the www.asp.net website.
Your Track action would do the same thing. You'd create a Track controller with an Index action and then in there you'd parse the querystring, log the information, and then return a RedirectResult to the URL you want to send the user.
Make sense?

Resources