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);
14 piwikTracker.setUserId(OSM.user.toString());
17 piwikTracker.trackPageView();
18 piwikTracker.enableLinkTracking();
20 $("meta[name=piwik-goal]").each(function () {
21 piwikTracker.trackGoal($(this).attr("content"));
26 $("body").on("piwikgoal", function (e, goal) {
27 piwikLoader.done(function () {
28 piwikTracker.trackGoal(goal);