You can automatically track all clicks on HTML links by activating the corresponding option in the request type setting 'page':

Configuration (request type setting 'page')

Event Tracking Type

 Click here to expand...
  • All HTML links are automatically tracked when clicked.
  • The target URL is taken as the event name.
  • An arbitrary link attribute (attribute can be configured under 'Link marking attribute') can be used for the unique labeling of links (in case multiple links with the same target exist).
  • You can also add URL parameters of the links or hashes to the name. All you need to do is to add the URL parameters as a comma-separated string or activate the 'Include hash in event name' option.

Advantages:

  • Very easy to implement.

 Disadvantages:

  • Link names can get very long.
  • No custom naming is possible.


Example for naming: Links at the page www.knigge.de without and with labeling (Link marking attribute=name)

LinkEvent name

<a href ="tablemanners.html">Link</a>

www.knigge.de.tablemanners.html

<a href ="tablemanners.html" name="nav1" >Link</a>

nav1.www.knigge.de.tablemanners.html


Example of good labeling convention: Labeling of link areas for a unique naming www.knigge.de


Standard

  • All labeled HTML links of a page are tracked when clicked.
  • An arbitrary link attribute (as specified under 'Link marking attribute') is used for the unique labeling and naming.

Advantages:

  • Allows a short and unique naming.
  • Not all links of a page have to be tracked (which could lead to fewer costs).

Disadvantages:

  • Higher effort for the integration.


Example for Naming: Links with Link marking attribute=name

LinkEvent name

<a href ="topics.html" name="nav1.topics" >Link</a>

nav1.topics

Delay next page

 Click here to expand...

Browsers sometimes change pages so fast that the track request cannot be submitted before the user has left the current page. Choose the option to delay loading the next page to ensure that all track requests are sent before navigating to the next page.

Please note that this option will slow down the navigation through your website so you should not set the delay time too high.

Event Parameter

 Click here to expand...

You can also add event parameters to send additional data for an event.

The configuration differs a bit from other parameter tables in the GTM template: while you still set the ID in the first column of the table, in the second column you don't map the tracking data of the data layer directly. Instead, you define the name of an HTML attribute.

The Pixel will then crawl the link element and all parent elements for this attribute and add the value as the event parameter data.

Let's have a look at a simple example. Say we have a link like this, embedded in a list:

<div data-group="list data">
    <ul data-ul="ul data">
        <li data-li="li data">
            <div data-div="div data">
                <a href="//www.domain.com/link/to/an/other/page.html">Link</a>
            </div>
        </li>
    </ul>
</div>
XML

Now we want to track the data of the attributes data-group, data-ul, data-li and data-div as event parameters 1 - 4. The configuration table would look like this:

Now, whenever a user clicks the link, the track request will have ck1 - ck4 parameter with the values of the attributes.

Please note that you have to create event parameters in your Mapp Intelligence account to track the data.

Updating links (request type setting 'event')

When automatic tracking of HTML links is executed, behind the scenes Mapp Intelligence Pixel will crawl your website for link elements and add a click-event listener with a tracking request as a callback.

This means all links that might be added dynamically to your page after the tag is fired will not be tracked because there is no event listener on them. To avoid losing any track data, it is necessary to update link tracking.

You have 2 options for this:

A) Execute the following function in your code:

wtSmart.extension.action.update();
JS

B) Configure an additional 'Event' tag, activate the reload function, and trigger it another time.

All you want to do here is to update link tracking. You normally do not want to send a track request when doing so. Therefore, you should use this setting in this instance of the tag: