Need HTML/CSS customization support? Upgrade to CyberChimps Plus.

New Google Analytics Code is being stripped

Home Forums Free Themes Support ForumNew Google Analytics Code is being stripped CyberChimpsNew Google Analytics Code is being stripped New Google Analytics Code is being stripped

This topic contains 2 replies, has 2 voices, and was last updated by  dwebd 3 months, 1 week ago.

  • Author
    Posts
  • #288876

    dwebd
    Participant

    Hello,

    The new google analytics code is being stripped and does not function in Cyberchimps Pro. Old style analytics codes work fine.

    I sent an email to private support but have not heard back?

    Correct Code:

    <!– Global site tag (gtag.js) – Google Analytics –>
    <script async src=”https://www.googletagmanager.com/gtag/js?id=MY ID NUMBER HERE”></script>
    <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag(‘js’, new Date());

    gtag(‘config’, ‘MY ID NUMBER HERE’);
    </script>

    After inserting the code via theme header options, the code is stripped to this and is not found by Google:

    <script type=”text/javascript”><!– Global site tag (gtag.js) – Google Analytics –>

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

    gtag(‘config’, ‘MY ID NUMBER HERE’);

    </script>

    Thanks in advance,

    Sincerely,

    Bob

  • #298056

    jordaneku
    Participant

    I was wondering if you ever got a response on this? I have a site that I can’t get the code to work either.

  • #298089

    dwebd
    Participant

    Yes, there is a new version of the theme that supposedly this was fixed, but I have not tried. I moved the code from the Google Analytics box in theme header options to the place to add the extra code theme options – header scripts. I am also using the Google Analytics Dashboard for WP (GADWP) plugin as a workaround on another site

You must be logged in to reply to this topic.