badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Google Analytics – Tracking Code not working

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #17347
    dnodmi
    Participant

    Dear all
    I added my tracking snipped to the respective place in the theme options and it shows up in the section right before the </head> tag. The snippet is correct and I can see it in the sourcecode.

    But, in Google Analytics, the data is not coming in.

    Any idea, where I can troubleshoot the problem?

    Many thanks
    D

    #17357

    Hi dnodmi,
    Could you specify it more clearly. We did not get exactly what you mean.

    Thank you!

    #17463
    dnodmi
    Participant

    Hi

    I added the Tracker Snippet from Google Analytics under “Theme Options” / “Webmaster Tools” / “Analytics”

    This is what shows up in the header before the closing head tag:

    <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','//www.google-analytics.com/analytics.js','ga');
    
      ga('create', 'UA-xxxxxxxx-x', 'auto');
      ga('send', 'pageview');
    
    </script><style type="text/css" media="print">#wpadminbar { display:none; }</style>
    <style type="text/css" media="screen">
    	html { margin-top: 32px !important; }
    	* html body { margin-top: 32px !important; }
    	@media screen and ( max-width: 782px ) {
    		html { margin-top: 46px !important; }
    		* html body { margin-top: 46px !important; }
    	}
    </style>
    
    </head>

    In Google Analytics on the other hand, no pageviews are registered.

    Do you guys know, how to troubleshoot it?

    Many thanks

    #17536

    Hi dnodmi,
    We are sorry for this. No any idea about it. If we found any solution then we will let you know.If you want to add this code then you may simply create a child theme and unhook this function and then add customise the code.

    add_action( 'interface_links', 'interface_add_links', 10 );
    /**
     * Adding link to stylesheet file
     *
     * @uses get_stylesheet_uri()
     */
    function interface_add_links() {
    ?>
    <link rel="profile" href="http://gmpg.org/xfn/11" />
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    <!--[if lt IE 9]>
    	<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script>
    	<![endif]-->
    <?php
    }

    This file is inside attitude-> library -> structure -> header-extension.php
    Do not change anything in parent theme just unhook the functions in child theme and customize the code. I will paste here a simple example to unhook functions for page 404.php

    unhook functions
    
    // Unhook default Thematic functions
    function unhook_thematic_functions() {
        // Don't forget the position number if the original function has one
    
    remove_action( 'attitude_404_content', 'attitude_display_404_page_content', 10 );
    
    }
    add_action('init','unhook_thematic_functions'); // removes the header content by using hook attitude_header
    
    add_action( 'attitude_404_content', 'attitude_child_display_404_page_content', 10 );
    /**
     * function to show the footer info, copyright information
     */
     
     
    function attitude_child_display_404_page_content() {      ?>   
    <div id="content">
    		<header class="entry-header">
    			<h1 class="entry-title"><?php _e( 'Error 404-Page NOT Found', 'attitude' ); ?></a></h1>
    		</header>
    		<div class="entry-content clearfix" >
    			<p>Thank you</p> 
    		</div><!-- .entry-content -->
    	</div><!-- #content -->
      <?php 
    }

    Do same as it. Hope you understand. You need to create just two files under child theme. One is functions.php and the next is style.css, The customised code must be kept under functions.php

    For more refrence
    http://codex.wordpress.org/Child_Themes
    If still you are unable then you may even hire a developer to fix it.
    Thank you!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.