--- title: "Automatic tracking of HTML links" slug: "automatic-tracking-of-html-links" updated: 2025-08-05T10:58:51Z published: 2025-08-05T10:58:51Z canonical: "docs.mapp.com/automatic-tracking-of-html-links" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.mapp.com/llms.txt > Use this file to discover all available pages before exploring further. # Automatic tracking of HTML links You can automatically track all clicks on HTML links by activating the corresponding option in the request type setting 'page': ![Settings for automatic tracking of HTML links with activation option highlighted.](https://cdn.document360.io/554b9b98-6720-4d8b-9919-c7b203d72648/Images/Documentation/image(366).png) ## Configuration (request type setting 'page') ### Event Tracking Type #### Link - All HTML links are automatically tracked when clicked. - The target URL is taken as the event name. - An arbitrary link attribute (which can be configured under 'Link marking attribute') can be used to uniquely label links (in case multiple links with the same target exist). - You can also add the URL parameters of the links or hashes to the name. To do so, 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) | Link | Event name | | --- | --- | | Link | www.knigge.de.tablemanners.html | | Link | **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 | Link | Event name | | --- | --- | | Link | nav1.topics | ### Delay next page 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 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: ```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: ![](https://cdn.document360.io/554b9b98-6720-4d8b-9919-c7b203d72648/Images/Documentation/image(367).png) 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](/v1/docs/how-to-set-up-custom-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: ```javascript wtSmart.extension.action.update(); ``` B) Configure an additional 'Event' tag, activate the reload function, and trigger it another time. ![](https://cdn.document360.io/554b9b98-6720-4d8b-9919-c7b203d72648/Images/Documentation/image(368).png) 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: ![](https://cdn.document360.io/554b9b98-6720-4d8b-9919-c7b203d72648/Images/Documentation/image(369).png)