• e dev

    (@efishinsea)


    When used to add gtag script into pages, we are ending up with this:

    <p><!-- Google Tag Manager -->
    <br>
    <script>(function(w,d,s,l,i){w[l]=w[l]| ..... });</script><br>
    <!-- End Google Tag Manager -->
    <br>our normal content here....our normal content here....our normal content here....our normal content here....our normal content here....our normal content here....our normal content here....</p>

    which obviously messes with the layout.

    To get around this for now, I have wrapped the gtag code in a span with a class and then added global css to give those matches a negative top margin:

    <span class="gtagfloat"><!-- Google Tag Manager --><script>(function(w,d,s,l,i){w[l]=w[l]|| ....});</script><!-- End Google Tag Manager --></span>
    
    
    
    p:has(span.gtagfloat) {
    	margin-top:-15px;
    }

    but it would be nicer if something like this was built into the plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Stefano Lissa

    (@satollo)

    Hi, that tag must be added to the head section not inside pages. Of course it would work, but when added into pages, the HTML elements are escaped. You cited wpbackery: are you using the head and footer plugin? Where are you adding the G tag?

    Thread Starter e dev

    (@efishinsea)

    Yes, you are correct. I am working on a client site and assumed they had something set up correctly, but now that you mention it and I review, they had the same ‘insert once in the header’ code inserted in many places incorrectly.

    Thanks for making me a take a second look.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘When using wpBakery, this is injecting br tags into content’ is closed to new replies.