[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
This commit is contained in:
argiro.kokogiannaki 2021-01-22 15:28:08 +00:00
parent 3ac191b39c
commit ce1b7a2c86
6 changed files with 12 additions and 9 deletions

View File

@ -99,7 +99,9 @@ import {animate, state, style, transition, trigger} from "@angular/animations";
</div>
<div class="footer uk-flex uk-flex-middle" [@footer]="state.toString()">
<span>Powered by</span>
<img width="120" src="assets/common-assets/logo-large-usage-counts.png">
<a href="https://usagecounts.openaire.eu" target="_blank">
<img width="120" src="assets/common-assets/logo-large-usage-counts.png">
</a>
</div>
</div>
</div>

View File

@ -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 => {

View File

@ -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 => {

View File

@ -146,11 +146,11 @@
<div class="main-tabs-div">
<ng-template #summary_tab>
<div class="uk-grid uk-margin-remove">
<!-- <div *ngIf="!hasPrimaryInfo" class="uk-width-expand uk-padding">
<div *ngIf="!hasPrimaryInfo && hasSecondaryInfo" class="uk-width-expand uk-padding">
<div class="uk-animation-fade uk-alert uk-alert-primary" role="alert">
No summary information available
</div>
</div>-->
</div>
<div *ngIf="hasPrimaryInfo" class="uk-width-expand uk-padding">
<!-- Description -->
<div *ngIf="resultLandingInfo.description" class="uk-margin-medium-bottom">

View File

@ -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 => {

View File

@ -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);