WordPress.org

Ready to get started?Download WordPress

Forums

Customizr
[resolved] Google Analytics (11 posts)

  1. KevMackenzie
    Member
    Posted 9 months ago #

    Where do I add the Google Analytics tracking code with WP theme ... Customizr?

  2. Wastabik
    Member
    Posted 9 months ago #

    The easiest way is to use the plugin called Google Analytics for WordPress by Yoast. You just need to fill in your Analytics account and authenticate it with Google.

  3. KevMackenzie
    Member
    Posted 9 months ago #

    Thanks for the reply

    I only find a plugin called "Google Analytics" by Kevin Sylvestre

    I have installed it previously - it kept Disabling it's self because it could verify my tracking code and everything is correct on the Analytic side.

    I have another website with WP theme by SMThemes called LightCafe - there is a "Integration" field on the Appearance menu where you can add you logo's, social links, sliders, etc.

    All I had to do was copy over the Analytics code and save.

    The theme I am using for the new domain is this theme called Customizr by nikeo. It's a really neat theme but I don't find a menu for to put my tracking code.

    I have followed the step by step tutorials to add it directly to the code in the editor function as well but it doesn't gel.

    Any other idea's?

  4. rdellconsulting
    Member
    Posted 9 months ago #

  5. KevMackenzie
    Member
    Posted 9 months ago #

    Thanks @Wastabik and @rdellconsulting - much appreciate your advise.

    This has seemed to solve the problem - now it's just to wait and see if its working by tomorrow this time.

  6. username_pg
    Member
    Posted 6 months ago #

    I don't want to download a plugin to track my website. Is there a way to add the google analytics tracking code directly in the Customizr theme?

  7. Andrew
    Forum Moderator
    Posted 6 months ago #

    Yeah, post a new thread about this http://wordpress.org/support/theme/customizr#postform

  8. ElectricFeet
    Member
    Posted 6 months ago #

    Nicolas explains how to do this here.

  9. username_pg
    Member
    Posted 6 months ago #

    Thanks Electric Feet. I just tried and its working great. Thanks!!

  10. xondra
    Member
    Posted 6 months ago #

    Hello everybody. I'm really not knowledgeable in php programming and I haven't managed to add my Google Analytics code the way Nicolas provided. That is, I don't know where exactly to put that code and how it should look like, and I keep getting errors in functions.php

    I ended up creating a child theme in order not to damage the original, and I think I will keep it that way considering what I've read on the advantages of having a child theme for customization.

    Thanks in advance!

  11. ElectricFeet
    Member
    Posted 6 months ago #

    Yes, this should be added in the child theme's functions.php. The entire functions.php file should sit in the child theme folder and — if you have no other functions in it — it should look like this:

    <?php
    add_action('wp_head','my_analytics',1,20);
    
    function my_analytics() {
        ?>
    
                YOUR GOOGLE ANALYTICS TRACKING CODE HERE
                (looks like <script type="text/javascript">.....</script> )
    
        <?php
    }

Reply

You must log in to post.

About this Theme

About this Topic