2 $(document).ready(function () {
3 var base = document.location.protocol + "//" + OSM.PIWIK.location + "/";
6 var piwikLoader = $.ajax({
7 url: base + "piwik.js",
10 success: function () {
11 piwikTracker = Piwik.getTracker(base + "piwik.php", OSM.PIWIK.site);
13 piwikTracker.trackPageView();
14 piwikTracker.enableLinkTracking();
16 $("meta[name=piwik-goal]").each(function () {
17 piwikTracker.trackGoal($(this).attr("content"));
22 $("body").on("piwikgoal", function (e, goal) {
23 piwikLoader.done(function () {
24 piwikTracker.trackGoal(goal);