Beware of the pitfalls of website analysis and monitoring implementation (next)

Source: Internet
Author: User
Keywords Traps vigilance

Intermediary transaction SEO diagnosis Taobao guest Cloud host technology Hall

Objective】

Continue to discuss some of the areas that need attention in the implementation of the Web analytics monitoring. For the last article, please see: Vigilant Web site analysis and monitoring implementation of the trap (above).

Body】

In the previous article, we explored the three areas where monitoring and implementation issues are easily monitored, such as cross-domain monitoring, reporting structure, and page dynamic event monitoring, which we then discuss outside chain monitoring, page redirection, monitoring framework pages, code conflicts, and custom basic monitoring settings.

Trap FOUR: Outer chain monitoring (outbound link tracking)

Tagging method (page Add Tag method) of the site analysis has a very important principle, that is, the number of clicks on a link to monitor, is actually clicked on the link after the new page to open the PV number. As shown in the following illustration:

  

In this case, the monitoring system used is that Google Analytics,ga code is added to the page rather than on each link, so we have a "new recruitment channel on the radio!" The number of clicks on this link depends on whether the monitor code is added to the new page it opens. If no code is added to the new page, or if the new page is not turned on properly, the click action itself does not drive any GA monitoring code, and the click Behavior itself cannot be monitored.

Therefore, in the case of GA default, the number of clicks for a link = the number of PV numbers of pages opened by it.

Since the site is your own, you can add code to each page on your site so that you can make sure that most of the links are recorded and that you can provide data for your page-click Hot maps. If you have made a hot map of a page in your own hands, you will know that the data source for the page hits the hot map is the next page report (GA is Entrance paths report), which is the principle used.

However, because we always have some special links on our website, they link to the destination address is not the other pages of their own station, but other sites, our trouble is coming.

  

For example, my blog has links to the columns, these links are linked to other sites, these sites did not add the same as my blog GA code-I want to add, people do not do ah!

So, we often fall into the trap is, when the need to get the number of chain clicks to find out that the original chain monitoring is not a Google Analytics standard solution, resulting in data loss. Some Web sites because of the use of Third-party customer service system, the user clicked on the customer service System link is actually outside the chain. These click data are significant for these sites.

  

To solve this problem, using Google Analytics Standard code is certainly not enough, we need to make some customization of the code. Now, I'm going to say "principle" again. But you can pretend to think so: because clicking on the link itself is a mouse event, so we can take the action of clicking the link as a "page dynamic event"-remember what I said in the previous section.

Therefore, we can fully use the chain as a "page dynamic event" to monitor, remember to add a "onclick"/"Onrelease" event on the line (see a trap three). For example (based on the latest asynchronous code):

Virtual Page method: <a href= "http://www.example.com" onclick= javascript:_gaq.push ([' _trackpageview ', '/g1/example.com ']); " >
Event Tracking Method: onrelease (Button) {GetURL ("Javascript:_gaq.push" (' _trackevent ', ' outboundlinks ', ' click ', ' Avinash Blog ']}

In each chain link to add these statements, you can realize the purpose of monitoring the chain, but if a page has many outside the chain, and you must have to monitor these outside the chain of clicks, how to do? You can monitor it one by one, but it's definitely a physical job. You can also use my following method, directly in the page to write a piece of code, so that the program automatically determine whether the link is outside the chain, if it is outside the chain, it automatically coupled with the monitoring of the outside chain code. This is definitely a good tool, is the bottom of the years of the baby.

The only pity is that the code is based on the previous version of GA code, not on asynchronous code. To use this code, you must switch back to the old code.


function attachenv () {

for (Var i=0;i<a.length;i++) {

A[i].onclick=function () {

if (this.href.indexOf (currenturl) = = 1) {

url = this.href.replace (/[^a-z| A-z|0-9]/g, "_");

str = '/outgoing/' + URL;

try{

Pagetracker._trackpageview (str);

}

catch (Err) {

}

}

}

}

}

if (Window.addeventlistener)

{

Window.addeventlistener ("Load", attachenv, false);

}

else if (window.attachevent) {

Window.attachevent ("onload", attachenv);

}

</script>

This code is not written by me, is my good friend happy to do out, thank you very much!

Are there any friends who are proficient in JavaScript who can write a new version of the current GA asynchronous code? Thank you very much!

Now, outside chain monitoring should not be a problem for you.

Finally, a digression. Google Analytics Help for two documentation on external chain monitoring: http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer= 55527,http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=72712 are based on the old version. I did not find an official document with an asynchronous code outside the chain. Please be careful not to apply the syntax of the old code to the new code directly, there will be mistakes.

Also wordy: Omniture sitecatalyst do not need additional programming, the system defaults to the monitoring of the external chain, this function is indeed more sweet.

Trap Five: Page redirection

Site page for a variety of reasons, need some jump, jump there are a variety of, such as the direct jump URL (server-side redirection), or browser-side redirection.

Redirection does not affect the monitoring of the PV number of pages, because no matter how to jump, will eventually jump to a specific entity page, in this entity page code, the page monitoring is not a problem.

The problem is that redirection can cause referrer (traffic source) chaos. Because of redirection, the traffic source for the real page is counted as the previous jump page.

In China International Airlines in the United States, due to the existence of the jump, home flow source will be mixed with a lot of "air-china.us" and airchina.us traffic, and actually air-china.us and airchina.us is the actual home page http:// www.airchina.us/en/index.html server-side jump.

  

In this case, you have to do a set on the server side, to allow the jump before the referrer automatically uploaded to the actual page after the jump, otherwise you will lose the real referrer information. I only know this method at present, I do not know whether there are other methods, it seems not. So this situation is more troublesome.

The jump that occurs on the client browser is relatively easy, because the browser-side jump has an extra blank page, so you can add the monitoring code to the blank page so that referrer information can be recorded properly. However, the problem with this method is that, because the jump before and after two pages have code, and the jump is automatic, so the GA code will be executed in a short time two times, resulting in bounce rate the sharp low, that is bounce rate can not normal monitoring. For this, please see my previous article.

Therefore, the browser-side jump monitoring the best way is also through the program, the jump before the page referrer information into the page after the jump, and the monitoring code is only added to the page after the jump. Specifically how to operate, not wordy, for the front-end engineers, this is not a big problem.

Trap Six: Frames page

Frame or IFrame also called the page nesting is the site analysis of the enemy, why so, I will not repeat, please see my previous article.

For the frames page, I think it is a site analysis and monitoring of a big pit, I think the best way to overcome this problem is to tell web designers or front-end engineers try not to take this approach to design the page (personally think this method is also an outdated web design method).

However, with the improvement of the front end of the page, it is difficult to see a page from a few large frame pieces of the situation, but only some local open some "small windows", such as my blog on the Google AdSense advertising system:

  

Small windows have little impact on our monitoring. My usual approach is to ignore these small windows and, when they don't exist, not to add extra code to these "little windows" pages unless they are very important.

Overall, in the processing of nested pages, adhering to the "catch big put small" principle, the main frame of the page code, and the secondary frames page.

Trap Seven: Code conflict

Because site analysis of page tagging relies on JavaScript code implementations, there is a possibility of conflict between the JavaScript code used for monitoring and other JavaScript code that exists on the site.

This possibility is small, but it does not never happen.

For GA, it is not likely to conflict with other JavaScript after new asynchronous code, but it is best to maintain uniqueness of classes, variables, and names of functions. If you use old code, then there is a greater likelihood of conflict, and the GA code itself class and related functions are not able to be modified name, so be sure to ensure that the other JavaScript and GA code insulation.

The class name of the Omniture Sitecatalyst code can be modified in the background, such as modifying the class "S" to "S2" to avoid conflicts with other programs.

Code collisions can cause monitoring to be impossible, so after the monitoring Code has been implemented, it is necessary to check that the monitoring code is working properly. The common method of monitoring and monitoring code is to use sniffer software, my favorite is HttpWatch, but the more powerful tool is Charles, also some friends with Wasp. Take HttpWatch as an example (click on the small picture to see the larger picture):

  

Using HttpWatch, we can see that the GA code requests the small image of the 1x1 pixel at run time, and the value of the query string appended to this request includes a lot of relevant information collected by GA, which indicates that the monitoring code is working properly.

Using these tools to check the execution of your code is what every Web site analytics implementation will do.

Trap Eight: Custom basic monitoring settings

This, basically can not be called a trap, but the beginner's friend still need to understand.

In Google Analytics, many of the underlying settings can actually be modified. For example, a friend of mine asked me that some contractual text on his site would take a long time to read, and probably more than 30 minutes for visitors to read without clicking on other pages, and what would be the way to extend visit (session) Expiration time. In fact, GA can be done.

For example, if you want to adjust to 1 hours for visit expiration, you can use the following methods:

  

If you want to modify the effective length of the UTM code (once the visitor clicks the link with the UTM parameter to enter the site, then this visitor, even if it's a collection of your site, will be considered to be visiting your site for the next 6 months, from the UTM definition of campaign. Until you expire or click on another UTM or visit your site from another referrer, you can use the following methods:

  

Because Google Analytics only think Google,baidu, such as a small number of internationally renowned search engines, so to join search, Sogou and so on, you need to manually set up, the following methods:

  

and other changes to the default settings, Google Analytics have a special introduction, see: Http://services.google.com/analytics/breeze/en/additional_ Customizations/index.html.

Finally, a small egg, introduced to everyone a may be useful Web site: http://www.clker.com/, this site has a lot of PowerPoint practical clip art. :)

It's your turn, any questions or suggestions? Please leave a message for me!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.