About JavaScript urchintracker ()

Source: Internet
Author: User

The most important part of gatc is a Java Script Function called urchintracker. This function is used to collect visitor data, store the data in cookies, and send the data to the Google Analytics server. Urchintracker appears in gatc as follows:

<SCRIPT src = "http://www.google-analytics.com/urchin.js" type = "text/JavaScript">

</SCRIPT>

<SCRIPT type = "text/JavaScript">

_ Uacct = "UA-XXXXX-X ";

Urchintracker ();

</SCRIPT>

Every time a page is refreshed, urchintracker is executed once and data is sent to the Google Analytics server. Each page Refresh has a unique name. The relevant data will be found in the URL column of the primary content report. Figure2 shows some simple data that appears in the primary content report.

In the data collection phase, urchintracker () extracts information from the relevant area of your browser. It is displayed as a correction value by removing domain names and domain extensions. The remaining subsequent directories, file names, and query character variables. These are called "access request URLs" and are also files generated during data processing (icon 1, step #6 ).

This is the default behavior of urchintracker (). You can also ignore this default behavior and name the page browsing record by specifying a parameter for urchintracker.

For example, change/index. the PHP page is displayed in the Google Analytics path. You can click index. the PHP page corrected urchintracker () as follows: urchintracker ('index page '). this modification allows urchintracker () to name the page wandering as "index page" instead of/index. PHP. The more profound impact of this change is that the "index page" instead of "/Index" is also displayed in the "access request URL. PHP ", which will also affect other settings and will be discussed later in other chapters of this book.

Urchintracker () is similar to other JavaScript Functions, which means it can be used wherever javascript can be executed. Therefore, if you place urchintracker () in the clickable area of an image, Google Analytics also records a page view when a user clicks the image. But how does this PV appear in Google Analytics? By default, the "access request URL" is also used ". Of course, you can also rename a function by yourself.

This technology can be used to monitor users' clicks, behaviors, and other browser events. For example, to monitor the clicks that link to other websites (called the outer hop link), you only need to add the urchintracker () parameter to the anchor tag of the appropriate click attribute. Do not forget to specify a parameter value for urchintracker () so that visitors can click it to confirm. In the "tips and techniques" section, we will also discuss how urchintracker () applies to more monitoring fields, such as monitoring flash, JavaScript, and non-HTML files.

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.