Skip to content

Commit

Permalink
Added matomo trackevent option
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Feb 11, 2024
1 parent 5e87d4c commit b724574
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/src/components/projectDetail/downloadOsmData.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ export const DownloadOsmData = ({ projectMappingTypes, project }) => {
var handle = window.open(downloadUrl);
handle.blur();
window.focus();
if (window._paq) {
// Check if Matomo tracking array (_paq) exists
window._paq.push(['trackEvent', 'OSMDownloads', 'Click', `${title}_${fileFormat}`]);
}
// Check if the request was successful
if (responsehead.ok) {
setIsDownloadingState({ title: title, fileFormat: fileFormat, isDownloading: false });
Expand Down

0 comments on commit b724574

Please sign in to comment.