Skip to content

Commit 4048907

Browse files
jzaeffererrdworth
authored andcommitted
Add analytics to footer. Fixes #120
(cherry picked from commit 677a7d9)
1 parent 28891b3 commit 4048907

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

mu-plugins/analytics.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
JQUERY_STAGING || add_action( 'wp_footer', function() { ?>
4+
<script>
5+
var _gaq = _gaq || [];
6+
_gaq.push(['_setAccount', 'UA-1076265-1']);
7+
_gaq.push(['_setDomainName', '<?php echo esc_js( $_SERVER['HTTP_HOST'] ); ?>']);
8+
_gaq.push(['_setAllowLinker', true]);
9+
_gaq.push(['_trackPageview']);
10+
11+
(function() {
12+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
13+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
14+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
15+
})();
16+
</script>
17+
<?php
18+
});

0 commit comments

Comments
 (0)