I just installed Open Web Analytics on my web server. I followed the installation steps as per the official GitHub page, and it was successfully installed on the server.
In the web pages where I want to add the tracker, I’m using the default JS code from the GitHub page to load the tracker (after replacing owa_baseUrl
with my domain and the site_id
):
<script type="text/javascript">
//<![CDATA[
var owa_baseUrl = 'http://your.domain.com/path/to/owa/';
var owa_cmds = owa_cmds || [];
owa_cmds.push(['setSiteId', 'your_site_id']);
owa_cmds.push(['trackPageView']);
owa_cmds.push(['trackClicks']);
owa_cmds.push(['trackDomStream']);
(function() {
var _owa = document.createElement('script'); _owa.type = 'text/javascript'; _owa.async = true;
_owa.src = owa_baseUrl + 'modules/base/js/owa.tracker-combined-min.js';
var _owa_s = document.getElementsByTagName('script')[0]; _owa_s.parentNode.insertBefore(_owa, _owa_s);
}());
//]]>
</script>
From what I understand, I should now be able to initialize tracker objects with:
OWATracker = new OWA.tracker();
However, OWA is not defined.