Google tracking code appears in header?

Discussion in 'Local Business WordPress Theme' started by tahoar, Nov 6, 2016.

Thread Status:
Not open for further replies.
  1. tahoar

    tahoar New Member

    Joined:
    Oct 30, 2016
    Messages:
    11
    Likes Received:
    1
    Why does my google tracking code appear in the header? If I remove the code from the Options/General Settings, it disappears.

    upload_2016-11-6_22-22-36.png
     
  2. Naveen

    Naveen Guest

    Joined:
    Aug 8, 2014
    Messages:
    1,739
    Likes Received:
    64
    It seems, you are not placing the complete code, please put the complete code there including script tags.

    This will resolve your issue,

    Warm Regards!
    Naveen Kolhe
    InkThemes.com
     
  3. tahoar

    tahoar New Member

    Joined:
    Oct 30, 2016
    Messages:
    11
    Likes Received:
    1
    this is the only code I have ever used. What do you think a "complete code" should look like?
     
  4. tahoar

    tahoar New Member

    Joined:
    Oct 30, 2016
    Messages:
    11
    Likes Received:
    1
    I think I found it. You should change the prompt to ask the user to enter their "tracking code script"

    <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-36040942-1', 'auto');
    ga('send', 'pageview');

    </script>
     
    dhl98034 likes this.
  5. Naveen

    Naveen Guest

    Joined:
    Aug 8, 2014
    Messages:
    1,739
    Likes Received:
    64
    That sounds great:)
     
Thread Status:
Not open for further replies.

Share This Page