• Resolved cnxsoft

    (@cnxsoft)


    I have an issue with Google Analytics and Lighthouse not detecting the <title> tag in AMP pages.

    Yoast SEO inserts the title tag properly, and as noted by Lighthouse developers, getting the title via JavaScript runs NULL (document.querySelector(‘title’)) See https://github.com/GoogleChrome/lighthouse/issues/12215

    But then I realized this script fails when viewing AMP using a mobile viewport, but works with a desktop viewport. So I repeated Lighthouse test using my AMP for mobile and desktop, and the latter fails (title not found), while the second works just fine.

    AFAIK the code is the same in mobile and desktop (tested with meld), so I don’t understand what’s going on here.

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Milind More

    (@milindmore22)

    Hello @cnxsoft

    This is very strange indeed, I am unable to reproduce this in my initial testing with just AMP and Yoast SEO plugin.

    I will recommend deactivating other plugin one by one and checking if that affects. you can also use Health and Troubleshooting plugin for the same.

    Also please send us your site health info using this form so we can try to investigate this further.

    Additionally, check with Yoast SEO support about the issue which has been reported previously, check if this quick fix here resolves your issue.

    Thread Starter cnxsoft

    (@cnxsoft)

    Thank you very much for your help. I found the culprit: “WPtouch Mobile Plugin”
    But I have not found a solution yet, as even if I suppress the plugin in AMP settings, the following code is still not able to get the title:

    var element = document.querySelector('title');
    alert(element.text);
    

    Just using AMP + WPTouch Mobile plugin also fails.

    • This reply was modified 5 years, 3 months ago by cnxsoft.
    • This reply was modified 5 years, 3 months ago by cnxsoft.
    Plugin Support Milind More

    (@milindmore22)

    Hello @cnxsoft

    I am unable to reproduce the title issue at my end using AMP and WPtouch plugin,
    It may be something else or a PRO feature that I can’t turn on,

    can you please confirm after deactivating WPtouch the issue got resolved?

    Thread Starter cnxsoft

    (@cnxsoft)

    Sorry about that, maybe yesterday there was some caching involved (I’m using Cloudflare).
    Now it works with AMP + WP Touch and AMP + Yoast SEO, but not with AMP + WP TOuch + Yoast SEO.

    I’m using the free version of WP Touch, and “Health & Troubleshooting” plugin for testing. If that can help, I’ll shot a screencast of my testing in case I’m doing something wrong.

    Thread Starter cnxsoft

    (@cnxsoft)

    THere’s only one line that differs:

    If I use AMP + Yoast only

    <div id="wpadminbar" class="nojq nojs mobile" data-ampdevmode="">

    If I use AMP + Yoast + WpMobile:
    <div id="wpadminbar" class="nojq nojs" data-ampdevmode="">

    The rest of the code is identical as far as I can tell.

    Thread Starter cnxsoft

    (@cnxsoft)

    Seeing the “wpadminbar” reference, I checked in an incognito window with another website with a similar setup (amp + yoast + wp mobile + other plugins), and if I’m not logged in, Lighthouse detects the title in AMP both in desktop and mobile.

    The original link still has the issue of not being able to detect the title in AMP in mobile mode, even in the incognito window. SO I’ll have to check a bit more.

    Plugin Support Milind More

    (@milindmore22)

    ok, I will be happy to assist if you can share your site health info using this form, which will help me check active plugins and themes, and configurations.

    but we confirmed that the issue not generated from the AMP plugin and some third-party plugin may be modifying the title.

    Thread Starter cnxsoft

    (@cnxsoft)

    Thank you. I have updated the form.

    I could share the same info for the working website if that could help.

    Plugin Support Milind More

    (@milindmore22)

    Hello @cnxsoft

    I am unable to reproduce the lost title issue at my end using your site health info, I am guessing it may because of the plugin configuration.

    Sorry, I can’t be much of help on this one, I will recommend debugging using the Health and Troubleshooting plugin.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘AMP Title mobile vs desktop’ is closed to new replies.