What determines where, in a page’s header, the Rank Math generated tags appear?

#87376
  • Resolved Adam Helman
    Rank Math free

    Hi

    When I look at 2 different sites I have, the Rank Math tags “section” appears in a different place on the page when viewing the source pages. On one site that section is right at the top of the header, in the other, it’s near the bottom of the header. I am wondering what controls this, and can I adjust it? I’m asking as I have to ensure a particular script is the very first on a page (to do with cookies and GDPR).

    An example of the “section” I’m referring to is in the sensitive data box…

    Many thanks,
    Adam

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello,

    Thank you for getting in touch with us.

    The <title> part control what you see in the browser tab and also the title you see when you search for your website in Google.

    The <meta name="description" part determines the description in Google search (most of the time it is auto generated though).

    Everything else has its own purpose too.

    The <script type="application/ld+json"> near the bottom is the part that determines the rich snippets:
    https://rankmath.com/kb/rich-snippets/

    The og tag refers to the OpenGraph tags that Facebook and WhatsApp use.

    The Twitter tags are pretty self-explanatory.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Er – thanks for the reply – but I didn’t ask for an explanation of the tags??? Please re-read the question. The key point I am asking about is where on the page you have placed your script and how that is controlled! I only included the script you insert to clarify.

    To reiterate…

    “I am wondering what controls this, and can I adjust it? I’m asking as I have to ensure a particular script is the very first on a page (to do with cookies and GDPR).”

    I have no issue with the script you insert in the head section – I just need to ensure it comes after another specific script.

    Hello,

    It is printed right after the wp_head hook.

    With that said, it might differ depending on how your theme has been coded.

    Once you add the GDPR script, please inspect the page source code so you can verify if the code is added before or after Rank Math’s code.

    Moreover, Rank Math doesn’t load any scripts for your users so it really doesn’t matter much if you are concerned about Rank Math being GDPR friendly or not. Since there is no user data collected, Rank Math is 100% GDPR compatible.

    Hi

    I have added the cookie code – and it comes after your. Any code I add will appears where I want it to in the theme. However, your code appears above all my code additions regardless of the position I state for my code, i.e. when I state the highest possible position for mine, yours is still above it, when ideally it should appear after it. I have no control over where you inject your script. That is fine (to a degree) except if you offer no control to the end-user regarding positioning you should ideally add it before the closing <head> rather than after the opening <head> tag – just as a general point.

    I understand you are GDPR compliant, however, to be compliant in the EU/UK then cookies also should only be enabled AFTER prior consent by visitors (whether an actual user or not) – unless that cookie is pre-categorised as necessary. The cookiebot service allows my site to do that, but only if any cookie scripts are positioned after it.

    Now, in this case, it may all be academic as I don’t think your script – which looks like it’s for schema – is doing anything with cookies anyway?

    Just to confirm in this case – as it’s not a cookie script – it is, in fact, academic and not a problem after all – though my point about its positioning I believe is still valid. However, I’ll close this as is and mark as resolved.

    Thanks again.

    Hello,

    If you need help with anything else, please open a new support ticket here so we can help:

    https://support.rankmath.com

    We are always here for assistance.

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

The ticket ‘What determines where, in a page’s header, the Rank Math generated tags appear?’ is closed to new replies.