• Resolved xtensions

    (@williamews)


    Hi. Thanks for the support.

    I realized there is an error showing at the top of the header of the website after upgrading… I noticed it’s an error coming from Google Analytics Tracking code added to the header of the website with Branda. Please check below… It’s the GA Tracking code, but it wasn’t supposed to be showing at the top of the website…

    window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag(‘js’, new Date()); gtag(‘config’, ‘…’);

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @williamews,

    Sorry to know that you are experiencing this issue.

    I checked this on my end using a test website but was unable to replicate the issue. Since the URL of the website was not mentioned, I wasn’t able to give a closer look at the issue. Can you please share the website URL so that we can help you further?

    We look forward to hearing back from you.

    Kind Regards,
    Nebu John

    industrialweb

    (@industrialweb)

    You’re seeing your conversion code without the <script> tag surrounding it.

    They broke all javascript capabilities with recent releases stripping this tag from all that code. Anyone with conversion codes, special triggers, or other important javascripts in Branda experienced this recently. They rolled it back, but soon all these sites will break again when they push the tracking-codes only change…

    Most people who know their way around ads and analytics use tracking codes and tags. This is going to break a lot of websites.

    This is mostly what a lot of used Branda for – it allowed marketers to have a place to insert scripts without needing to know PHP or try to edit templates, and to keep them well-organized.

    Plugin Support Saurabh – WPMU DEV Support

    (@wpmudev-support7)

    Hi @williamews

    Sorry to hear you are having this issue.

    Effectively, as @industrialweb mentioned, this was being caused by some recent changes in the Branda plugin to prevent XSS attacks, but since the tracking code needs the script tag our team applied a fix as the best approach to keep the site secure and also output the code as it should.

    New tracking code scripts should be added using the tracking codes as a mu-plugin:

    <?php
    add_action('wp_head', 'wpmudev_add_tracking_code');
    function wpmudev_add_tracking_code() {
    	?>
    	<script type="text/javascript">
                // Codes
    	</script>
    	<?php
    }

    You can add the above snippet as a mu-plugin on your site:
    https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    More information about the security enhancement can be found in our documentation: https://wpmudev.com/docs/wpmu-dev-plugins/branda/#tracking-codes

    Kind Regards,

    Luis

    Thread Starter xtensions

    (@williamews)

    @wpmudev-support7 Thanks for the updates.

    I think the second option with the Measurement ID is more secure like you stated, so I will look into using the option instead.

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error at the Top of Header’ is closed to new replies.