Link is not tracked or missing link category statistics
    • 9 Minutes to read
    • Dark
      Light

    Link is not tracked or missing link category statistics

    • Dark
      Light

    Article summary

    By default, Engage tracks links in sent messages. This means that the source code for a hyperlink to a website in a mail will be redirected through the Engage system using a unique specific URL, where the system will save a link click linked to a particular recipient, save any category data to note a click on a link category if category tracking is set, then redirects the recipient to the original target link. This happens in a fraction of a second.

    HTML hyperlinks are defined by the use of the anchor tag, or "<a>". Content between the opening anchor tag, and the corresponding closing anchor tag ("</a>") will be clickable and take you to the URL defined in the opening anchor tag's "href" argument.

    Why Engage may not track a link

    In some cases, Engage will not track a link, so clicks on that link will not be tracked. and if categories are set on the link, the category will not be set either).

    This can happen in the following circumstances:

    • If a "do not track" tag - ecm:tracking="false" - is explicitly set on a link: the link tracker will ignore all links with this tag

    • If link tracking is disabled on the group level where no links at all will be tracked

    • If there is a problem in the HTML source code where the links are badly defined, missing, or a link is contained within a link (invalid HTML)

    • If the value of the href the argument does not start with http://  or https:// 

    • If the whole link ( including the http://  or https:// protocol part) depends on a custom attribute value.

    What happens if a link is not tracked?

    If a link is not tracked in Engage, the link will work as defined in the HTML source code of the message: when a recipient clicks on that link in the received message, they will not be transported to Engage to record the link before being redirected to the actual link target but will be taken directly to that link target without being referred back to Engage.

    Due to this:

    • Clicks on untracked links will not be tracked by Engage;

      • Note that Engage will also consider a tracked link click as an open linked to the recipient, so even if the open tracking pixel is not downloaded, any click will be counted against the open rate - but without link tracking this metric cannot be updated

    • You cannot update a non-tracked link target URL after a sendout.

    • Conversion tracking will not work on an untracked link, as the link parameters or cookie, depending on your conversion tracking setup require the tracking redirection to send user and message IDs to the recipient browser, and this will not happen on a non-tracked link.

    • Visual reporting cannot report click rates on untracked links.

    Stop tracking a specific link in the HTML link code

    In the HTML code of a link (<a href="http://example.com">), you can add a specific tag called ecm:tracking="false" to tell Engage to not track that specific link. From there, the link will be sent untouched and untracked to recipients, even if tracking is enabled in the group settings for the group used by the message.

    Such a link will look like this:

    <a href="http://example.com" ecm:tracking="false">My non tracked link</a>

    Link Tracking disabled on a group level

    Tracking on any message can be controlled in the settings of the group linked to the message, in the "Tracking & Links" section where open and link tracking options can be set or unset.

    Link tracking can be disabled for one or several categories of links in the "Track Link Clicks" section. By default, all link types are tracked.

    Common HTML issues causing a link to not be tracked

    Most of the time, bad HTML is the cause of unexpected link tracking issues: The rule to remember in both HTML and Engage link parsing is that links cannot contain links (no embedding links in links), and every opening anchor tag must have a corresponding closing anchor tag: The tags must be "balanced".

    Embedded hyperlinks

    Example:

    <a href="http://example.com/page1.html">This is my first link<br/>    <a href="http://example.com/page2.html">This is my second link</a> </a>

    Even if a recipient's browser or email client may allow you to click on both of these links, given that the "page1" link does not terminate with an anchor close tag (</a>), undefined things can happen such as

    • Clicks on the "This is my second link" link could take you to page1.html rather than the expected "page2.html"

    • The "page2.html" link may work as expected and take you to the corresponding page, but Engage will only apply link tracking to the "page1.html" link, as this is the first, and so link & category tracking may not be applied.

    Embedded <a> tags

    Overview

    HTML does not allow hypertext links to be embedded inside another link, as explained in the HTML standard available from the World Wide Web Consortium's website:

    "The a element may be wrapped around entire paragraphs, lists, tables, and so forth, even entire sections, so long as there is no interactive content within (e.g. buttons or other links)"

    You must ensure that you never embed a hyperlink <a> tag in between another <a> and </a> tag.

    Simple example:

    • Is Valid: <a href="http://example.com/page1.html">This is my first link</a><a href="http://example.com/page2.html">This is my second link</a>

    • Is not valid: <a href="http://example.com/page1.html">This is my first link<a href="http://example.com/page2.html">This is my second link</a></a>

    Any code that is not valid as in the second example above will have problems with link tracking, statistics, and redirections.

    Engage links must contain an href argument containing the corresponding hyperlink, starting with http:// or https:// the without any unencoded spaces. The URL in the href argument must be valid and the URL must be on one single line: There must be no line breaks in the URL from start to end between the <a> element's href's quote marks.

    In-depth explanation and example

    This means that the following code example is invalid:

    <a href="http://example.com/page1.html">This is my first link<br/> <p>Here is some text that will be parsed as part of the link even if this is unexpected</p> <p>And this paragraph has a new link<a href="http://example.com/page2.html">This is my second link</a>

    Quirks Mode

    There are differences between the actual W3C HTML standard and the actual browser interpretation of HTML code, called "quirks mode". Quirks Mode allows a browser to make its best attempt to interpret what the web designer was attempting to do, even if the rules of the HTML standard are not strictly adhered to.

    In the example above, you can see that there are two <a> tags that open, but only one </a> tag that closes, and so, the browser may (but has no guarantee or obligation to) attempt to understand what the designer wanted.

    So, in a browser, in Quirks Mode, when a visitor clicks on the "This is my first link", the browser may take them to page1.html, and clicking on "This is my second link" may take them to page2.html.

    HTML standard and Engage Link Processing

    Under the W3C HTML standard, as noted in the overview, embedding one HTML <a> tag inside another <a> tag is not standards-compliant. You must ensure that every opening <a> tag is closed with a </a> tag before opening a new <a> tag.

    Engage will look for hyperlinks in the <a> tag, will modify the href parameter that contains the target URL to redirect it via the Engage system, save details about the click into the system stats and then redirect the clicker onto the original URL target that is saved in Engage for this message. Engage identifies links, as per the HTML standard, by looking for an element starting with <a> and must absolutely finish with </a>

    From the example above:

    Quirks Mode interpretation

    The invalid may be understood as 2 links

    • First link - a click anywhere here will take you to page1.html


    • Second link - a click anywhere here will take you to page2.html

    HTML standard & Engage interpretation

    There is only one link: From the first <a> to the first corresponding </a>: so any click anywhere in this block should take you only to page1.html and the link to page2.html is invalid and ignored.

    Problems that this can cause

    Engage applies the W3C standard interpretation, so the code example above will be processed by Engage and redirect the link to page1.html through engage for tracking purposes for any visible text all the way through to the first corresponding </a> tag, BUT the second standards-invalid link will be unchanged.

    As explained in the HTML standard available from the World Wide Web Consortium's website:

    "The a element may be wrapped around entire paragraphs, lists, tables, and so forth, even entire sections, so long as there is no interactive content within (e.g. buttons or other links)"

    You must ensure that you never add another hyperlink <a> tag in between an existing <a> and </a> tag.

    When this code is sent to a recipient, anyone clicking on "This is my second link" will be taken directly to page2.html as this link is not tracked by Engage as the code is invalid, and no clicks at all will be saved in the Engage statistics.

    This can be an issue if there is a bug in the customer code, whereby a text link is not closed, and possibly the second link is a big "click here" image: the link on the image will not be redirected and tracked by Engage, because it is encapsulated within the redirected link by Engage, but the browser, detecting invalid HTML enters quirks mode, and the person browsing the page, to click on the link and use the untracked link.

    Solution:

    • Make sure that every opening <a> element has a corresponding </a> element

    • Make sure that you do not embed an <a> element between an <a> and its corresponding </a>.

    Such an issue can also happen if a client forgets to close their anchor tag, so there is an opening "<a>" tag, but no corresponding "</a>" tag, for example:

    <a href="http://example.com/page1.html">This is my first link<br/> <p>Here is some text that will be parsed as part of the link even if this is unexpected</p> <p>And this paragraph has a new link<a href="http://example.com/page2.html">This is my second link</a>

    In the example above, the anchor tag for page1.html is "unbalanced" as it is not closed with a closing anchor tag, so technically, and as parsed by Engage, the complete content all the way to the first closing anchor tag found will be considered as linked to the first anchor, and the second anchor to page2.html is invalid HTML syntax.

    Unclosed <a> tag

    This will cause a similar problem to an embedded tag - the tag is opened with an <a>  but there is no corresponding closing </a>  tag, or if another anchor tag is present further down in your HTML, the end of that tag will be taken as the end, therefore causing an unbalanced tag issue.

    This can also cause your message sendout to fail, as Engage will not be able to store the amount of data it identifies between the opening tag and the corresponding closure as an HTML tag.

    Best practices in case of link issues

    If you encounter issues with links or in the HTML code of your message, we strongly recommend that you review your HTML content with your designer, and attempt to ensure that your HTML passes the World Wide Web Consortium's HTML validation - or gets as close as it can to passing.

    The World Wide Web Consortium (W3C) defines the HTML standards. The HTML code validation tool can be found here.

    Knowledge Base Reference ID: 201901230614


    Was this article helpful?