How to Add Tracking Code to Just Before the </body> tag
I would like to add visitor measuring code to my ClassiPress website that I've obtained from Quantcast. (https://www.quantcast.com
Quantcast instructions state that the code needs to be placed just before the </body> tag and any other measurement tags. See code below.
<!-- Quantcast Tag -->
var _qevents = _qevents || ;
var elem = document.createElement('script');
elem.src = (document.location.protocol == "https:" ? "https://secure" : "http://edge") + ".quantserve.com/quant.js
elem.async = true;
var scpt = document.getElementsByTagName('script');
<img src="//pixel.quantserve.com/pixel/p-8Zpe9ncrvJ7CV.gif" border="0" height="1" width="1" alt="Quantcast"/>
<!-- End Quantcast tag -->
I've been trying to figure out how and where to add the code. As best as I've been able to discern the code is either added to the theme-footer.php file or the Footer file. Also it seems that the code needs to be added as a "hook".
I'm not sure what a "hook" is, how to write a "hook" for this code and where to place the "hook".
Any assistance would be appreciated.