From ce1b7a2c86c1eb2d15afff44c8e163affce502c4 Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Fri, 22 Jan 2021 15:28:08 +0000 Subject: [PATCH] [Library|Trunk] Piwik: download give the current url instead of the blob url. Remove url parameter from trackDownload() Metrics: add usage counts link in the logo git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60280 d315682c-612b-4755-9ff5-7f18f6832af3 --- landingPages/landing-utils/metrics/metrics.component.ts | 4 +++- landingPages/organization/organization.component.ts | 2 +- landingPages/project/project.component.ts | 4 ++-- landingPages/result/resultLanding.component.html | 4 ++-- searchPages/searchUtils/searchDownload.component.ts | 2 +- utils/piwik/piwik.service.ts | 5 +++-- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/landingPages/landing-utils/metrics/metrics.component.ts b/landingPages/landing-utils/metrics/metrics.component.ts index d750212e..dde0a3d5 100644 --- a/landingPages/landing-utils/metrics/metrics.component.ts +++ b/landingPages/landing-utils/metrics/metrics.component.ts @@ -99,7 +99,9 @@ import {animate, state, style, transition, trigger} from "@angular/animations"; diff --git a/landingPages/organization/organization.component.ts b/landingPages/organization/organization.component.ts index 8cc3ec2a..41c26e23 100644 --- a/landingPages/organization/organization.component.ts +++ b/landingPages/organization/organization.component.ts @@ -361,7 +361,7 @@ export class OrganizationComponent { //window.open(window.URL.createObjectURL(data)); if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { - this.subscriptions.push(this._piwikService.trackDownload(this.properties, url, this.piwikSiteId).subscribe()); + this.subscriptions.push(this._piwikService.trackDownload(this.properties, this.piwikSiteId).subscribe()); } }, err => { diff --git a/landingPages/project/project.component.ts b/landingPages/project/project.component.ts index 637b95e4..da44d81b 100644 --- a/landingPages/project/project.component.ts +++ b/landingPages/project/project.component.ts @@ -431,7 +431,7 @@ export class ProjectComponent { this.download(url, filename+".csv"); if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { - this.subscriptions.push(this._piwikService.trackDownload(this.properties, url, this.piwikSiteId).subscribe()); + this.subscriptions.push(this._piwikService.trackDownload(this.properties, this.piwikSiteId).subscribe()); } }, error => { @@ -537,7 +537,7 @@ export class ProjectComponent { this.download(url, filename+".html"); if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { - this.subscriptions.push(this._piwikService.trackDownload(this.properties, url, this.piwikSiteId).subscribe()); + this.subscriptions.push(this._piwikService.trackDownload(this.properties, this.piwikSiteId).subscribe()); } }, err => { diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index 300efd55..a01b4b4d 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -146,11 +146,11 @@
- +
diff --git a/searchPages/searchUtils/searchDownload.component.ts b/searchPages/searchUtils/searchDownload.component.ts index 088fcba8..bf9198a2 100644 --- a/searchPages/searchUtils/searchDownload.component.ts +++ b/searchPages/searchUtils/searchDownload.component.ts @@ -111,7 +111,7 @@ export class SearchDownloadComponent { //window.location.href = window.URL.createObjectURL(data); if (this.isPiwikEnabled && (typeof document !== 'undefined')) { - this.subscriptions.push(this._piwikService.trackDownload(this.properties, url, this.piwikSiteId).subscribe()); + this.subscriptions.push(this._piwikService.trackDownload(this.properties, this.piwikSiteId).subscribe()); } }, error => { diff --git a/utils/piwik/piwik.service.ts b/utils/piwik/piwik.service.ts index 711cc153..09d40571 100644 --- a/utils/piwik/piwik.service.ts +++ b/utils/piwik/piwik.service.ts @@ -25,10 +25,11 @@ export class PiwikService { } } - trackDownload (properties:EnvProperties, downloadURL, siteId = null):any { + trackDownload (properties:EnvProperties, siteId = null):any { var ua = this.getUserAgent(); var referrer = this.getReferrer(); - var url = properties.piwikBaseUrl+((siteId!=null)?siteId:properties.piwikSiteId)+"&rec=1&url="+StringUtils.URIEncode(downloadURL)+"&download="+StringUtils.URIEncode(downloadURL)+ + var url = properties.piwikBaseUrl+((siteId!=null)?siteId:properties.piwikSiteId)+"&rec=1&url="+StringUtils.URIEncode(location.href)+"&download="+StringUtils.URIEncode(location.href)+ + "&action_name="+StringUtils.URIEncode("Download titleeee!!!!")+ ((ua != null && ua.length > 0)?('&ua='+StringUtils.URIEncode(ua)):'')+ ((referrer != null && referrer.length > 0)?('&urlref='+StringUtils.URIEncode(referrer)):''); //console.log("Piwik - trackDownload: "+url);