[Support request] Script in wp_head Hook makes a white space above page header in frontend

Home Forums Support [Support request] Script in wp_head Hook makes a white space above page header in frontend

Home Forums Support Script in wp_head Hook makes a white space above page header in frontend

  • This topic has 5 replies, 2 voices, and was last updated 7 years ago by Tom.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #307711
    Hermann

    Hi,

    I have added a Google Script into wp_head Hook. If I look in the frontend there suddenly is a white space above my page header. If I remove the script, the white space disappears and the layout is correct again. No matter if I use a child theme or not.

    Here is the URL: http://wpland.heuser-webjobs.de

    Can anybody help? Thank you very much.
    Hermann

    #307762
    Tom
    Lead Developer
    Lead Developer

    Hmm, seeing some broken HTML. You’re sure you’ve added the code to the wp_head hook and not the Before Header hook?

    Can you show me the code you’re adding?

    #308035
    Hermann

    Hello Tom,

    yes, I have added the code in wp_head. And I have installed another wordpress with the same confuíguration on another server. And the same problem occurs.

    Here is the code:

    <!-- Google Code for Remarketing Tag -->
    <!--------------------------------------------------
    Remarketing tags may not be associated with personally identifiable information or placed on pages related to sensitive categories. See more information and instructions on how to setup the tag on: http://google.com/ads/remarketingsetup
    --------------------------------------------------->
    <script type="text/javascript">
    /* <![CDATA[ */
    var google_conversion_id = xxxxxxxx;
    var google_custom_params = window.google_tag_params;
    var google_remarketing_only = true;
    /* ]]> */
    </script>
    <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
    </script>
    <noscript>
    <div>
    <img height="1" width="1" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/xxxxxxxx/?guid=ON&script=0" />
    </div>
    </noscript>
    #308190
    Tom
    Lead Developer
    Lead Developer

    I believe it’s the <img> tag in there inside the <noscript> tags. What happens if you remove everything between <noscript></noscript>?

    #308394
    Hermann

    Hi Tom,

    I have removed the complete content between <noscript> and </noscript>. Now theres only the following code in wp_head hook, but there is no difference in frontend. Still the white space above the page.

    Greets, Hermann

    <!– Google Code for Remarketing Tag –>
    <!————————————————–
    Remarketing tags may not be associated with personally identifiable information or placed on pages related to sensitive categories. See more information and instructions on how to setup the tag on: http://google.com/ads/remarketingsetup
    —————————————————>
    <script type=”text/javascript”>
    /* <![CDATA[ */
    var google_conversion_id = xxxxxxxxx;
    var google_custom_params = window.google_tag_params;
    var google_remarketing_only = true;
    /* ]]> */
    </script>
    <script type=”text/javascript” src=”//www.googleadservices.com/pagead/conversion.js”>
    </script>

    #308598
    Tom
    Lead Developer
    Lead Developer

    Have you removed the code completely? I’m not seeing any gap anymore.

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