This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

V1.1 Analytics

  • Creator
    Topic
  • #10189
    mizzinc
    Participant

    Hi Jason,

    Now that the Config Tab and Analytic’s has been removed. Would the best practice to include the Analytics information be:

    if( ! function_exists( 'themeblvd_analytics' ) ) {
    	function themeblvd_analytics() {
    		echo "<script type=\"text/javascript\">
    			  var _gaq = _gaq || [];
    			  _gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
    			  _gaq.push(['_trackPageview']);
    			  (function() {
    				var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    				ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    				var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    			  })();
    			</script>\n";
    	}
    }
    add_action( 'wp_head', 'themeblvd_analytics', 2 );
Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #10213
    Jason Bobich
    Keymaster

    Sure, you can do that if you want. At this point, by manually hooking to wp_head, you’re essentially just taking the Google Analytics code they gave you and putting it in your <head> like the instructions say to do.

    I also posted a plugin that you can use, too, that’ll do this same thing essentially. —

    http://wordpress.org/plugins/simple-analytics/

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.