Last active
November 4, 2016 14:59
-
-
Save BFTrick/bb3b3b0e0497e8adecfa00e3c8e1b33d to your computer and use it in GitHub Desktop.
Load Heap Analytics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Plugin Name: Heap Analytics | |
* Plugin URI: https://gist.github.com/BFTrick/bb3b3b0e0497e8adecfa00e3c8e1b33d | |
* Description: Send all site data to Heap Analytics | |
* Author: Patrick Rauland | |
* Author URI: http://speakinginbytes.com | |
* Version: 1.0 | |
*/ | |
// load heap analytics | |
add_action('wp_head','patricks_load_heap_analytics', 30); | |
function patricks_load_heap_analytics() { | |
?> | |
<script type="text/javascript"> | |
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=t.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=(r?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+e+".js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n);for(var o=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","removeEventProperty","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=o(p[c])}; | |
heap.load("278165378"); | |
</script> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment