-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtracker.js
More file actions
53 lines (44 loc) · 1.37 KB
/
tracker.js
File metadata and controls
53 lines (44 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
(function () {
function init() {
Matomo.on('TrackerSetup', function (tracker) {
tracker.WeatherReports = {
setWeather: function (
cloud,
condition,
feltTemperature,
humidity,
precipitation,
pressure,
temperature,
uv,
visibility,
windDirection,
windSpeed
) {
var request = "ping=1";
request += "&weather_cloud=" + cloud;
request += "&weather_condition=" + condition;
request += "&weather_felt_temperature=" + feltTemperature;
request += "&weather_humidity=" + humidity;
request += "&weather_precipitation=" + precipitation;
request += "&weather_pressure=" + pressure;
request += "&weather_temperature=" + temperature;
request += "&weather_uv=" + uv;
request += "&weather_visibility=" + visibility;
request += "&weather_wind_direction=" + windDirection;
request += "&weather_wind_speed=" + windSpeed;
tracker.trackRequest(request);
}
};
});
}
if ('object' === typeof window.Matomo) {
init();
} else {
// tracker might not be loaded yet
if ('object' !== typeof window.matomoPluginAsyncInit) {
window.matomoPluginAsyncInit = [];
}
window.matomoPluginAsyncInit.push(init);
}
})();