• Resolved Lars

    (@labemi)


    Let Site Kit place code on your site in Tag Manager connected service adds html anchor tag attributes after DOM upon clicking any link on any page on frontend.

    How to replicate

    1. Call provided website URL
    2. Click any link. For better verification use a link that doesn’t lead to a new page:
      For example: Click tel:-Link with telephone number on top menu (and cancel actual call) or “Problem melden” above footer (click outside of popup box to return to page)
    3. Scroll down to bottom of the page
    4. See that href="tel: has been added in plain text after the HTML document
    5. (optional) Repeat and verify repetitive behaviour

    In Chrome’s developer tools “event listeners” I found the click listener of gtm.js being the cause of this behaviour. Once disabled this problem does not occur.

    Disabling the option Let Site Kit place code on your site in Tag Manager connected services also makes the problem disappear.

    gtm.js creating output after the HTML is probably caused by

    {
    "function": "__html",
    "metadata": ["map"],
    "unlimited": true,
    "vtp_html": "href=\u0026quot;tel:",
    "vtp_supportDocumentWrite": false,
    "vtp_enableIframeMode": false,
    "vtp_enableEditJsMacroBehavior": false,
    "tag_id": 7
    }

    …although I have no idea why this output is actually being sent to the end of the document.

    What is happening here?

    Cheers

    • This topic was modified 5 days, 11 hours ago by Lars.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support James Osborne

    (@jamesosborne)

    Thanks for reaching out @labemi. I’d certainly be happy to perform some checks on this. From first inspection I suspect this may be related to one of the optimization configurations applied with another plugin. To determine more on this, please share the following:

    1. Your Site Health information. You can use this form to share privately if preferred.?
    2. Does the same occur if you temporarily deactivate your optimization plugin? I ask as I don’t see any trace of Site Kit active at present, but this may be due to modifications by plugins. The Tag Manager snippet I can see doesn’t match the snippet placed via Site Kit.

    Note also that I did perform some checks on your site and I can see Tag Manager references relating to me clicking on a link, your number. This doesn’t seem to be Site Kit specific, but once wehave the above information we can determine more on this. From checking your sites source code, it’s optimized and minified. With that I don’t see any trace of Site Kit being active.

    …although I have no idea why this output is actually being sent to the end of the document.

    What is happening here?

    I suspect it’s not specific to Site Kit and more of a multi plugin conflict. Such unusual behaviors are not uncommon when multiple optimizations are applied on a site (independent of using Site Kit).

    Please let me know also if you’re happy for me to close your other support topic regarding this. Thank you!

    Thread Starter Lars

    (@labemi)

    Hi James, thanks for your answer. I’ve had Autoptimize activated for non-logged-in users but that was configured to not optimize javascript at all, only css. Anway, autoptimize is now fully deactivated and I have no other similar tool running.

    Health report available here: https://bin.digilan.ch/?228ca7902df840bd#HXDN248RkmDqJpM5VhWqxHE6bg6w2zcYAnZxneoYVpju

    Yes, the redundant second topic can be closed, ofc, sorry. This topic here seemed to have vanished at first.

    Thank you.

    Plugin Support James Osborne

    (@jamesosborne)

    Thanks for the update @labemi, much appreciated. I can see still see some HTML being output. For the next check, we’ll see if this is third party plugin, theme or child theme related. Please follow the steps below in order to do so:

    1. Login to your live site from a Chrome browser incognito window.
    2. Navigate to “Plugins > Health Check & Troubleshooting > Troubleshoot”.
    3. From the same screen click on the “Available Plugins” tab at the top right and then click on the “Enable” option next to “Site Kit by Google“.
    4. Visit your site once more and click on any anchor link, or check for the same error. While checking, you’ll notice that a core theme is in use. This is only for you, as a logged in administrator.

    When checking the above, I suspect no HTML will be output with another theme active. Let me know the outcome from your testing, or ask if you have any questions. Thank you.

    Thread Starter Lars

    (@labemi)

    Hi James, thanks again.

    I followed the instructions and in troubleshooting mode with default theme and only Site Kit plugin the issue is still present (see screenshot):

    Plugin Support James Osborne

    (@jamesosborne)

    Sorry to hear that @labemi, but not to worry. We’ll perform some additional checks. To do so, please share the following:

    1. What tags do you have active in the container you have selected within Site Kit?
    2. Does the same occur if you revisit your Google Tag settings within Site Kit and temporary switch to a different container (Site Kit > Connected Services > Google Tag Manager > Edit)?
    3. Do you have any optimizations applied at host level?

    Note also that this isn’t a widespread problem. I have been performing some checks and I don’t encounter the same on some test sites, but with a little but more effort I’m sure we’ll determine the cause. Thank you!

    Thread Starter Lars

    (@labemi)

    Thank you so much for the hint to the tags in TM. For some reason I had a funny “Tel Link” tag (custom HTML) configured. I suppose it was setup to identify tel: links on link clicks trigger but somehow messed up the experience.

    Thanks again, problem is solved.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.