Google Analytics (Google analysis) is Google’s free Web site analysis services, since its inception, that is well received. Google Analytics is very strong, as long as the pages on the site to add a code, it can provide a wealth of detailed reports, charts. Today, I will summarize some of the code by adding skills, the use of different formats urchinTracker code, web site can track some special events (for example, will not produce the comprehensive hits, JavaScript events, documents downloaded station links, etc.) tracking can also develop the attributes (for example, Adsense, complete reverse link). Of course, reading skills before they read the post, “Google analyst Help” main content.
source of this page: williamlong.info/archives/816.html
A statistics of the non-HTML documents Click
The website document tracking a link, through the link labeled <a> adding onClick attribute to achieve, examples are as follows :
<A href=”https://mustafaturan.wordpress.com/” mce_href=”https://mustafaturan.wordpress.com/” onClick = “javascript : urchinTracker ( ‘/ rss.xml More Content»’); “>
Noted that the use of this property must be Analytics tracking code on the front of HTML code, the best <body> below.
tracking Adwords
Google Analytics official has direct support tracking Adwords. Please refer to the detailed steps “how Google Analytics (analysis) account link to AdWords ds account? . ”
In addition, vdgraaf also provided a revised code manually, can also achieve the same function, Examples of such changes are :
_uacct = “**-******-*”; / / your creatures code generated by Google Analytics cs
If (document.referrer)
{
If (document.referrer.indexOf ( ‘google’) ! = -1)
{
Var is = / (\? | &) Q =([^&]*)/;
Var = urlPattern.exec aMatches (document. referrer);
If (aMatches! = Null)
{
UrchinTracker ( ‘/ query /’ + aMatches [2]);
}
Else
{
UrchinTracker ();
}
}
Else
{
UrchinTracker ();
}
}
Else
{
UrchinTracker ();
}
Then the “content optimization” – “content effects” – “content breakdown” — View directory query information, good to be content with its “optimized marketing” – “search engine marketing” – “pay-per-click and the natural conversion” – Google Adwords compare the data.
tracking Adsense Click
We have previously described the Adsense tracking software only to the user clicks on record. Statistics do not possess the function, if we want to click on advertisements in the past statistics, then the direct use Google Analytics to achieve statistical functions.
To achieve the general approach is :
The Google Adsense ads below to add the following statement
<script Type=”text/javascript”>
Log function () (
UrchinTracker ( ‘/ blogs’);
}
Var elements2;
Elements2 = document.getElementsByTagNam e ( “iframe”);
For (var i = 0; I <elements2.length; + + I) (
If (elements2 [i]. Src.indexOf ( ‘googlesyn dication.com ‘)> -1) (
Elements2 [i]. Onfocus = log;
}
}
</script>
After a good change, please do not click on Google test But will Google be locked accounts, as long as you slowly waiting for Google Analytics statistical information can be.
Another seobook also introduced a method, the basic principle is similar.
tracking all point out link
Use the following statement can point out all the tracking link.
Window.onload = setAdsLinks;
SetAdsLinks function ()
{
Var = document.getElementsByTagName Links ( ‘A’);
For (var i = 0; I <Links.length; I + +)
{
Links [i]. Onclick = function () (
UrchinTracker (this.href);
}
}
}
Attention, the use of the code necessary to Google Analytics statistics code on most front pages, Also, such statistics have a side effect and that is if the website hyperlinks to many of these statements will affect the performance of the browser and even “writings” of the state.
showing the complete reverse link
The statistical sources, Google Analytics show only domain information, we may amend statistical code, Google Analytics showed achieve complete reverse link
_uacct = “**-******-*”; / / These are the Google Analytics code
/ / Use the following code to replace the original code.
If (document.referrer)
{
UrchinTracker (document.referrer);
}
Else
{
UrchinTracker ();
}
modify the code to display the reverse link
Google officials did not provide a revised code can also show that the integrity of the source, in “Optimizing Marketing” – “sub-groups of visitors effects” – “visited source,” source address selected icon on the left, click on “inter-group results,” another point “content” can return to the static URL specific sources of data, the static method for the source address, Dynamic addresses (such as search results) will not use this use.