All Products
Search
Document Center

Common tracking types

Last Updated: May 11, 2022

The Web common automatic tracking solution (mtracker) is a common tracking solution for PC and mobile HTML5 pages. The solution realizes the automatic reporting of logs by setting the tag attribute. This solution is used in mobile HTML5 page to report the event logs of page display, click, and exposure.

Before configuring common tracking, you need to learn about the tracking types used in different business scenarios:

PV tracking

After you introduce the mtracker, the system records a PV count in the log every time the page is opened, and you don't have to do any extra operations.

Click tracking

Click tracking records the clicks on certain buttons and links on a page.

Tag-based tracking

  • The mtracker monitors click events, and automatically adds log about clicks for the tags with and data-seed attribute.

      <div seed="seedname"></div>
  • If you need bizType, you can add the extended attribute prefixed with data-biztype which will also be logged together with seed attribute.

    <div data-seed="seedname" data-biztype="xxx"></div>
  • If you need extra click event information, you can add the extended attribute prefixed with data-mtr- which will also be logged together with seed attribute. The extended attribute actually logged will have data-mtr- removed.

      <div seed="seedname" data-mtr-extra1="111" data-mtr-extra2="222" >
      </div>

Trigger actively

In some business scenarios, you must manually trigger click events. For example, different clicks on the same tag need to be logged to different points based on judgment. At this time, the JS click tracking method Tracker.click(eventId, options) is needed.

  • Parameter instructions

Parameter

Type

Example

Description

eventId

String

clickseedname

Event ID

options

Object

Options, including bizType, ext.

bizType

String

Pay

Business type

ext

Object

{productId: ‘xxx’ }

Extended parameter

  • Code sample

Tracker.click('clickseedname', { bizType: 'Pay', ext: { productId: 'xxx' } });

Exposure tracking

Exposure tracking records the exposure of certain content on a page.

If the exposure event is required to be manually triggered, such as a carousel display, you need to use the JS exposure event logging method tracking.expo().

Tracker.expo(eventId, options)
  • Parameter instructions

Parameter

Type

Example

Description

eventId

String

exposeedname

Event ID

options

Object

Options, including bizType, ext.

bizType

String

Pay

Business type

ext

Object

{productId: ‘xxx’ }

Extended parameter

  • Code sample

Tracker.expo('exposeedname', { bizType: 'Pay', ext: { productId: 'xxx' } });