Ga code statistics-event tracking

Source: Internet
Author: User

1. Set event tracking

Call the _ trackevent () method in the source code of a webpage object, widget, or video.

_ Trackevent (category, action, opt_label, opt_value );

CATEGORY category: (required) specify a name for the object group to be tracked. Generally, the same category name can be used for related user interface elements that want to be classified into the specified category multiple times.

Action: (required) an action that has a unique ing with each category.ActionParameter to name the type of events or interactions that you want to track for a specific webpage object. For example, in a "videos" category, you can use this parameter to track multiple specific events.

Opt_lable label: (optional) it provides an optional string of extra dimensions for the event data and provides additional information for the event to be tracked, such as the title of the video in the preceding example, or the name of the file to be downloaded.

Opt_value: (optional) It can be used to provide an integer for the numerical data of user events and provide additional information for the events to be tracked, such as the title of the video in the preceding example, or the name of the file to be downloaded.

2. Event tracking

For example, to track the user interaction of the three independent controls of playing, pausing, and stopping the same video interface, you can use the following methods:

_ Gaq. Push (['_ trackevent', 'videoos', 'play', 'My Love']);

_ Gaq. Push (['_ trackevent', 'videoos', 'pause', 'My Love']);

_ Gaq. Push (['_ trackevent', 'videoos', 'stop', 'My Love']);

Videos is a category, play, pause, stop is an operation, and my love is a tag.

Ga code statistics-event tracking

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.