Why do my Google Analytics URLs begin with slashes? - google-analytics

When looking at Google Analytics, all reports show URLs that begin with a slash and www: "/www.url.com/page.html."
I've never seen Google report like this. Webmaster Tools is set up correctly. Not sure what else can be set up in Analytics. Any idea?
Current: /www.url.com/page.html
Typical: /page.html

by default GA only reports the relative path and query string of the URL (it strips the protocol and domain. So one of two things must be happening:
1) you have code that is passing a custom page name to the _trackPageview call, adding that "/[domain]".
2) you have a custom filter within the interface setup that is prefixing the page name with "/[domain]"
Adding the domain to the page name is a fairly common thing to do when you have GA code spanning multiple domains, most especially when they are going to a rollup profile, so that you can see which pages are coming from which domain.
So if I had to guess (and this is only a guess, seeing as how I don't have access to your
code or GA interface), someone must have attempted to rebuild the full url to use as the page name instead of just the path+querystring - and then messed up (probably a messup in some regex with the protocol, if I wanted to throw even more guesses at it).
But the 64 thousand dollar question is.. where is it being changed? Like I said.. GA by default does not do this, so someone has added code to do it on your site, or else a filter within the interface.
I would start by looking to see if there are any filters in your interface, since that is the easier thing to determine. If you see no filters relevant to this, then you will have to look on your page code (including any script includes or other javascript code being output). It would be a value passed with _trackPageview so ctrl+f for that.

Related

Tracking Clicks [Outbound Links] with Autotrack.js

I am trying to find a clear method of tracking clicks to external sites from a site I have built, it appears a lot of information available on this is contradictory or incomplete. I have found autotrack.js on Github which looks like a simpler method, so my question is three-fold, I'll make the question super clear so there is a super clear answer for others in the same conundrum as me.
What snippet/script is added to the HTML and where? I currently have the standard GA snippet for tracking page loads before the </body> tag.
Should I amend / edit the <a> tags to make sense of the who clicked what? I.e. name them, can this be avoided or automated, what I mean is there a script smart enough to name it the same as the destination, like reallygoodlist.com or fb.com/reallygoodlist ?
Is there any GA work required? Set up Goals etc, ideally I would be looking to avoid this - I have a lot of links.
Here is my site (if it helps):
http://www.reallygoodlist.com
1) What snippet/script is added to the HTML and where? I currently have the standard GA snippet for tracking page loads before the tag.
The installation and usage section of the autotrack documentation shows how to install autotrack, so I'll just link to it rather than repeating.
If you're just using the default GA tag, you can probably copy/paste most of the code there, changing the parts relevant to you: e.g. if you only care about outbound link tracking, then only include the outboundLinkTracker plugin.
It also looks like you're installing code via npm, so in this case you can link autotrack's source file in the node_modules directory as you've done with the Babel polyfill.
<script src="node_modules/autotrack/autotrack.js"></script>
2) Should I amend / edit the tags to make sense of the who clicked what ? i.e. name them, can this be avoided or automated, what i mean is ether a script smart enough to name it the same as the destination, like reallygoodlist.com or fb.com/reallygoodlist ?
Autotrack's outboundLinkTracker plugin automatically sets the link's URL as the event label, so you probably don't need to do anything unless that's not enough.
If you want more control than that, setting one of the common options will allow you to custom any data that is sent to GA.
3) Is there any GA work required? Set up Goals etc, ideally I would be looking to avoid this - I have a lot of links.
Not for outbound link tracking. It's just tracking the data as events, so you'll be able to find them in your event reports in GA.

What are the effects of changing the default page in Google Analytics?

I am new to Google Analytics and need to make a change, we are adding site search. I can't save the site search change because GA has some incorrect info in it and will not let me save any changes. Specifically, the default page can't have slashes. So, when I try to save my other change, I get this error.
It seems to me that the info that we have now is incorrect and isn't being used by Google.
I am pretty confident that if I remove the "avcat/ctl1642/index.cfm" from the default page I will be able to save it. I am not sure of what effect this will have on reporting, but I will never be able to re-enter that value if it isn't correct.
What are the effects of removing this bit of info? Should I just leave it blank? Shoud I just use index.cfm
Here is the current information that is saved.
The default page is the page that is displayed when a directory name is entered without a filename. For example: A user types mydomain.com/mydirectory/ into the browsers adress bar and the server serves the page mydomain.com/mydirectory/index.html. The exact name of the default page depends on the server configuration (usually it's along the lines of index.html, index.php, index.aspx, default.aspx or similar).
However Google will count mydomain.com/mydirectory/ and mydomain.com/mydirectory/index.html as two different pages, even though they display the same content. So you can enter the name of the default page in Google Analytics to make sure the page count for both urls is aggregated into one value. The value for default page is applied to every url that ends with a trailing slash (and without a filename) since Google assumes that this is a directory name that displays the default page.
"vcat/ctl1642/index.cfm" does not make any sense as setting for a default page since it includes a directory path; a path is not a page. I'm amazed that it was ever possible to enter that value. If Google Analytics actually applied that value then all urls that ended with slash will be mangled (i.e. will have vcat/ctl1642/index.cfm added to them). Removing the value will mean that this does not happen anymore.

How to track urls without sessions and encrypted url in google analytics in a decent way?

General setting
I have a website, which uses regular and encrypted urls. Now I want to track the pageviews or all pages the same way.
I have regular URLs like this:
/library.dll?page=page12&arg1=0&arg2=some&session_id=7892734
and special pages like this:
/library.dll?page=specialpage&arg1=0&arg2=some&session_id=7892734&id=page13
aswell as encrypted URLs like this, which are also containing the session id:
/library.dll?page=encrypted&args=gYZEI7lnRAQLzVXdtdbcral8.cOoc6NDtMUGY2yep9wO3JM
So the interesting niformation is always the page, which is in this examples page12, page13 and page14 (where page14 is also part of the encrypted string).
Clarification
I can change the HTML and JS code only. I have no access to the Google Analytics interfaces at all. This will be administrated by multiple customers.
The GA code will be integrated within a template using a customer-specific code and their unique tracking id.
Problem description
I need to track the page argument, because this is basically the interesting part of the url. When tracking other url parameters I cannot accumulate the pageviews for a certain page, because Google Analytics shows them as separate pages.
In addition I don't see any way to track the pageviews with encrypted URLs, because I cannot set a generic name for them unless there is a way to utilize the method ga('send', 'pageview');
Solution idea
I read about overwriting the pageview attributes like this:
ga('send', 'pageview', '/my-overridden-page?id=1');
in the article on page tracking #Google Developers
Utilizing (event) triggers is in my opinion a pretty bad idea.
The question itself
Is there any smarter way to track this information? Is extracting the page-information and overwriting the pageview attributes the best way to do this?
I just started using GA and have kind of no idea how to do this any other way.
You could use filters (custom advanced filters) to rewrite the request url inside the google admin interface (admin->views->filters). This has the advantage that you do not need to change your site/application code.
However using filters will require multi-step-filters with heavy use of regular expressions, and you would have to test this in a "staging" view first (because a wrong filter will permanently mess up your data).
Passing a custom url to the pageview tracking is pretty straightforward and can be tested immediately via the real time view. In my opinion this is indeed the smartest way to do this.

Google Analytics (Internet Marketing - Tracking website - Query Parameter)

If there is no query parameter in the url of search bar results and I want to track inside google analytics what guests search inside Search bar on my website then I need to add the following code inside the GA tracking code:
pageTracker._trackPageview("/searchresults.html?q=$keyword");
but how to translate it into new version of tracking code? with gaq word.
Also whoever would be willing to answer please say if I have to change $keyword or keyword with anything else or can I type EXACTLY this?
Also please say where exactly, inside google analytics tracking code, do I need to paste the code line? Probably somewhere around word var but don't know where...
Simply use:
_gaq.push(['_trackPageview','/searchresults.html?q=$keyword']);
it can be anywhere in your page, it should replace the default
_gaq.push(['_trackPageview']);
call
You will need to have server side code (PHP, ASP, ...) fill in the value for $keyword.
Next, you will need to enable search term parsing in your GA Profile(s) settings.
Beware to use a parameter name ('q' here) that isn't used for other purpose in your site, elese every URL logged to GA and containing this parameter will be parsed as search query and the value will be considered as a keyword.

Why does Google Analytics cross-domain tracking across an iframe require tracking snippets in both domains?

I'm creating a shareable widget, for anyone to copy onto their website. The shareable piece of code is an frame that points to the actual widget that lives on our hosted site (i.e. ourdomain.com). If we ever want to tweak the actual widget, we can do so in one place, with no effect on the iframes pointing to it from other sites we have no control over.
I tried the approach of cross domain tracking. While I was analyzing the results, I observed that the path of the shared widget code (not on our domain) appears within the content view in GA. This runs counter to a response from my previous post "if it is being inserted into many domains you are going to need to set up multiple GA accounts and use different account numbers per user."
Correct me if I am wrong: Any tracking code using our unique account id will appear in our GA by default, no matter where it's hosted, whether the code is implementing cross domain tracking or not.
http://www.google.com/support/forum/p/Google+Analytics/thread?tid=6af5b4c3e30c71be&hl=en
Since any page that hosts GA tracking code shows up in our content view, I could locate where the widget is being viewed by simply looking for all pages whose name did not include ourdomain.com. Of course this includes proxy servers as well, but I was going to also include a custom variable so I could implement a filter based on the custom variable.
So explain to me where this breaks down or what I'm missing here. Is there some amount of data I am losing here because the GA cookie is not in fact being utilized? Give me a good reason why I should put in the effort to fully implement cross domain tracking, including the necessary P3P implementation on our server for IE visitors.
As a sidenote, I am considering adding GA tracking code with an event tracker within the widget itself to track when people actually USE the widget (as distinct from the when the widget is loaded). I understand that by not implementing cross domain tracking I would not be able to obtain any data about the visitor, only whether the widget was acted upon or not.
As the referring site is the primary bit of information we need,
I'm going to pass the referrer in the URL that loads the iframe content
and then overide the referrer within the tracking code
_gaq.push(['_setReferrerOverride',ht_referrer]);
as documented here:
http://www.prusak.com/google-analytics-referrer-override/
This way, I don't need to inject tracking code into my widget, just some JavaScript that adds the referrer to the URL that loads the iframe.
Wish me luck.

Resources