Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Analytics kills Dashboard with Blank page


r-a-y
Keymaster

@r-a-y

Sandeep didn’t wrap the open and close php tags properly…

Replace whatever is in his PHP file with this:

<?php
/*
Plugin Name: BP Analytics
Description: Do you even need this plugin?
Author: Whatever
Version: 1.0
*/

function bp_ga_analytics() {
?>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-XXX");
pageTracker._trackPageview();
} catch(err) {}</script>

<?php
}

add_action('bp_after_footer', 'bp_ga_analytics');
?>

Skip to toolbar