add piwik id - enable tracking in all components

This commit is contained in:
argirok 2021-11-09 12:31:44 +02:00
parent 81695838f7
commit bf6c1db2cc
26 changed files with 130 additions and 72 deletions

View File

@ -1,8 +1,12 @@
import {Component, Input} from '@angular/core';
import {Component} from '@angular/core';
import {properties} from "../../../environments/environment";
@Component({
selector: 'openaire-directLinking',
template: `<directLinking></directLinking>`
template: `
<directLinking [piwikSiteId]="piwikSiteId"></directLinking>`
})
export class OpenaireDirectLinkingComponent {
piwikSiteId = properties.piwikSiteId;
}

View File

@ -1,10 +1,13 @@
import {Component} from '@angular/core';
import {properties} from "../../../environments/environment";
@Component({
selector: 'openaire-linking-generic',
template: `<linking-generic pageTitle="Linking"></linking-generic>`
template: `<linking-generic pageTitle="Linking" [piwikSiteId]="piwikSiteId"></linking-generic>`
})
export class OpenaireLinkingComponent {
piwikSiteId = properties.piwikSiteId;
}

View File

@ -2,13 +2,14 @@ import {Component} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
import {Subscriber} from "rxjs";
import {properties} from "../../../environments/environment";
@Component({
selector: 'openaire-my-claims',
template: `
<my-claims *ngIf="userInfoURL && claimsInfoURL" [claimsInfoURL]=claimsInfoURL [userInfoURL]="userInfoURL">
<my-claims *ngIf="userInfoURL && claimsInfoURL" [claimsInfoURL]=claimsInfoURL [userInfoURL]="userInfoURL" [piwikSiteId]="piwikSiteId">
</my-claims>
`
@ -17,6 +18,8 @@ import {Subscriber} from "rxjs";
claimsInfoURL:string;
userInfoURL: string;
sub;
piwikSiteId = properties.piwikSiteId;
constructor (private route: ActivatedRoute) {
}
ngOnDestroy() {

View File

@ -1,14 +1,15 @@
import {Component} from '@angular/core';
import {properties} from "../../environments/environment";
@Component({
selector: 'openaire-deposit',
template: `
<deposit-first-page></deposit-first-page>
<deposit-first-page [piwikSiteId]="piwikSiteId"></deposit-first-page>
`
})
export class OpenaireDepositComponent {
piwikSiteId = properties.piwikSiteId;
constructor() {
}

View File

@ -1,13 +1,15 @@
import {Component} from '@angular/core';
import {properties} from "../../environments/environment";
@Component({
selector: 'openaire-search-deposit',
template: `
<deposit-search-dataproviders></deposit-search-dataproviders>
<deposit-search-dataproviders [piwikSiteId]="piwikSiteId"></deposit-search-dataproviders>
`
})
export class OpenaireSearchDataprovidersToDepositComponent {
piwikSiteId = properties.piwikSiteId;
constructor() {}

View File

@ -5,6 +5,8 @@ import {properties} from "../../environments/environment";
import {Router} from "@angular/router";
import {AggregatorInfo, PortalAggregators} from "../utils/aggregators";
import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
import {Subscription} from "rxjs";
@Component({
selector: 'develop',
@ -90,13 +92,18 @@ import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
export class DevelopComponent implements OnInit {
public aggregator: AggregatorInfo = null;
subs: Subscription[] = [];
constructor(private seoService: SEOService,
private _meta: Meta,
private _router: Router,
private _title: Title) {
private _title: Title, private _piwikService:PiwikService,) {
}
public ngOnDestroy() {
for (let sub of this.subs) {
sub.unsubscribe();
}
}
ngOnInit() {
let id = ConnectHelper.getCommunityFromDomain(properties.domain);
@ -113,6 +120,9 @@ export class DevelopComponent implements OnInit {
this._meta.updateTag({content: description}, "property='og:description'");
this._meta.updateTag({content: title}, "property='og:title'");
this._title.setTitle(title);
if(properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.subs.push(this._piwikService.trackView(properties, "OpenAIRE").subscribe());
}
}else {
this.navigateToError();

View File

@ -1,10 +1,13 @@
import {Component, ViewChild, ElementRef} from '@angular/core';
import {Component} from '@angular/core';
import {properties} from "../../../environments/environment";
@Component({
selector: 'openaire-dataprovider',
template: `<dataprovider></dataprovider>`,
template: `<dataprovider [piwikSiteId]="piwikSiteId"></dataprovider>`,
})
export class OpenaireDataProviderComponent{
piwikSiteId = properties.piwikSiteId;
constructor ( ) {
}

View File

@ -1,10 +1,13 @@
import {Component} from '@angular/core';
import {properties} from "../../../environments/environment";
@Component({
selector: 'openaire-dataset',
template: `<result-landing type="dataset"></result-landing>`,
template: `<result-landing type="dataset" [piwikSiteId]="piwikSiteId"></result-landing>`,
})
export class OpenaireDatasetComponent{
piwikSiteId = properties.piwikSiteId;
constructor ( ) {
}

View File

@ -1,10 +1,13 @@
import {Component, ViewChild, ElementRef} from '@angular/core';
import {Component} from '@angular/core';
import {properties} from "../../../environments/environment";
@Component({
selector: 'openaire-htmlProjectReport',
template: `<htmlProjectReport></htmlProjectReport>`,
template: `<htmlProjectReport [piwikSiteId]=""></htmlProjectReport>`,
})
export class OpenaireHtmlProjectReportComponent{
piwikSiteId = properties.piwikSiteId;
constructor ( ) {
}

View File

@ -1,10 +1,13 @@
import {Component} from '@angular/core';
import {properties} from "../../../environments/environment";
@Component({
selector: 'openaire-organization',
template: `<organization></organization>`,
template: `<organization [piwikSiteId]="piwikSiteId"></organization>`,
})
export class OpenaireOrganizationComponent{
piwikSiteId = properties.piwikSiteId;
constructor ( ) {
}

View File

@ -1,10 +1,13 @@
import {Component} from '@angular/core';
import {properties} from "../../../environments/environment";
@Component({
selector: 'openaire-orp',
template: `<result-landing type="orp"></result-landing>`,
template: `<result-landing type="orp" [piwikSiteId]="piwikSiteId"></result-landing>`,
})
export class OpenaireOrpComponent{
piwikSiteId = properties.piwikSiteId;
constructor ( ) {
}

View File

@ -1,10 +1,13 @@
import {Component} from '@angular/core';
import {properties} from "../../../environments/environment";
@Component({
selector: 'openaire-project',
template: `<project></project>`,
template: `<project [piwikSiteId]="piwikSiteId"></project>`,
})
export class OpenaireProjectComponent{
piwikSiteId = properties.piwikSiteId;
constructor ( ) {
}

View File

@ -1,11 +1,14 @@
import {Component} from '@angular/core';
import {properties} from "../../../environments/environment";
@Component({
selector: 'openaire-publication',
template: `
<result-landing type="publication"></result-landing>`,
<result-landing type="publication" [piwikSiteId]="piwikSiteId"></result-landing>`,
})
export class OpenairePublicationComponent {
piwikSiteId = properties.piwikSiteId;
constructor() {}

View File

@ -1,7 +1,11 @@
import {Component} from '@angular/core';
import {properties} from "../../../environments/environment";
@Component({
selector: 'openaire-publication',
template: `<result-landing type="result"></result-landing>`,
template: `<result-landing type="result" [piwikSiteId]="piwikSiteId"></result-landing>`,
})
export class OpenaireResultComponent{}
export class OpenaireResultComponent{
piwikSiteId = properties.piwikSiteId;
}

View File

@ -1,12 +1,14 @@
import {Component} from '@angular/core';
import {properties} from "../../../environments/environment";
@Component({
selector: 'openaire-software',
template: `<result-landing type="software"></result-landing>`,
template: `<result-landing type="software" [piwikSiteId]="piwikSiteId"></result-landing>`,
})
export class OpenaireSoftwareComponent{
constructor ( ) {
piwikSiteId = properties.piwikSiteId;
constructor ( ) {
}
ngOnInit() {

View File

@ -9,14 +9,14 @@ import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properti
@Component({
selector: 'openaire-advanced-search-dataprovider',
template: `
<search-dataproviders [customFilter]="customFilter" [simpleView]="false" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/dataproviders'">
<search-dataproviders [customFilter]="customFilter" [simpleView]="false" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/dataproviders'"
[piwikSiteId]="properties.piwikSiteId">
</search-dataproviders>
`
})
export class OpenaireAdvancedSearchDataProvidersComponent {
customFilter: SearchCustomFilter = null;
properties: EnvProperties;
constructor ( ) {}

View File

@ -9,7 +9,8 @@ import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properti
@Component({
selector: 'openaire-advanced-search-organizations',
template: `
<search-organizations [customFilter]="customFilter" [simpleView]="false" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/organizations'">
<search-organizations [customFilter]="customFilter" [simpleView]="false" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/organizations'"
[piwikSiteId]="properties.piwikSiteId">
</search-organizations>
`

View File

@ -8,7 +8,8 @@ import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properti
@Component({
selector: 'openaire-advanced-search-projects',
template: `
<search-projects [customFilter]="customFilter" [simpleView]="false" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/projects'">
<search-projects [customFilter]="customFilter" [simpleView]="false" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/projects'"
[piwikSiteId]="properties.piwikSiteId">
</search-projects>
`

View File

@ -8,7 +8,8 @@ import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properti
@Component({
selector: 'openaire-search-results',
template: `
<search-research-results resultType="result" [simpleView]="false" [customFilter]="customFilter" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/research-outcomes'"></search-research-results>
<search-research-results resultType="result" [simpleView]="false" [customFilter]="customFilter" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/research-outcomes'"
[piwikSiteId]="properties.piwikSiteId"></search-research-results>
`
})

View File

@ -7,11 +7,12 @@ import {properties} from "../../../environments/environment";
@Component({
selector: 'openaire-search-find',
template: `
<search-all logoURL = "/assets/common-assets/logo-small-aggregator.png" name="OpenAIRE" [customFilter]="customFilter"></search-all>
<search-all logoURL = "/assets/common-assets/logo-small-aggregator.png" name="OpenAIRE" [customFilter]="customFilter" [piwikSiteId]="piwikSiteId"></search-all>
`,
})
export class OpenaireSearchComponent{
customFilter:SearchCustomFilter= null;
piwikSiteId = properties.piwikSiteId;
constructor ( ) {}
ngOnInit() {
let id = ConnectHelper.getCommunityFromDomain(properties.domain);

View File

@ -9,7 +9,8 @@ import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properti
selector: 'openaire-search-dataproviders',
template: `
<search-dataproviders [customFilter]="customFilter" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/dataproviders'">
<search-dataproviders [customFilter]="customFilter" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/dataproviders'"
[piwikSiteId]="properties.piwikSiteId">
</search-dataproviders>
`

View File

@ -9,7 +9,8 @@ import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properti
selector: 'openaire-search-organizations',
template: `
<search-organizations [customFilter]="customFilter" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/organizations'">
<search-organizations [customFilter]="customFilter" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/organizations'"
[piwikSiteId]="properties.piwikSiteId">
</search-organizations>
`

View File

@ -9,7 +9,8 @@ import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properti
selector: 'openaire-search-projects',
template: `
<search-projects [customFilter]="customFilter" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/projects'">
<search-projects [customFilter]="customFilter" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/projects'"
[piwikSiteId]="properties.piwikSiteId">
</search-projects>
`

View File

@ -8,7 +8,8 @@ import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properti
@Component({
selector: 'openaire-search-results',
template: `
<search-research-results resultType="result" [stickyForm]="false" [customFilter]="customFilter" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/research-outcomes'" ></search-research-results>
<search-research-results resultType="result" [stickyForm]="false" [customFilter]="customFilter" [openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/research-outcomes'"
[piwikSiteId]="properties.piwikSiteId"></search-research-results>
`
})

View File

@ -4,7 +4,7 @@ export let properties: EnvProperties = {
environment: "beta",
adminToolsPortalType: "aggregator",
dashboard: "explore",
enablePiwikTrack: false,
enablePiwikTrack: true,
useCache: false,
useLongCache: true,
showAddThis: true,
@ -45,7 +45,7 @@ export let properties: EnvProperties = {
vocabulariesAPI: "https://beta.services.openaire.eu/provision/mvc/vocabularies/",
piwikBaseUrl: "https://analytics.openaire.eu/piwik.php?idsite=",
piwikSiteId: null,
piwikSiteId: "553",
loginUrl: "https://beta.services.openaire.eu/explore-login/openid_connect_login",
userInfoUrl: "https://beta.services.openaire.eu/uoa-user-management/api/users/getUserInfo?accessToken=",
@ -71,7 +71,7 @@ export let properties: EnvProperties = {
resultsPerPage: 10,
"baseLink" : "",
"domain":"https://beta.explore.openaire.eu",
"domain":"https://beta.canada.explore.openaire.eu",
searchLinkToResult: "/search/result?id=",
searchLinkToPublication: "/search/publication?articleId=",

View File

@ -45,7 +45,7 @@ export let properties: EnvProperties = {
vocabulariesAPI: "https://services.openaire.eu/provision/mvc/vocabularies/",
piwikBaseUrl: "https://analytics.openaire.eu/piwik.php?idsite=",
piwikSiteId: "109",
piwikSiteId: "553",
loginUrl: "https://services.openaire.eu/uoa-user-management/openid_connect_login",
userInfoUrl: " https://services.openaire.eu/uoa-user-management/api/users/getUserInfo?accessToken=",
@ -73,7 +73,7 @@ export let properties: EnvProperties = {
resultsPerPage: 10,
"baseLink" : "/",
"domain": "https://explore.openaire.eu",
"domain": "https://canada.explore.openaire.eu",
searchLinkToResult: "/search/result?id=",
searchLinkToPublication: "/search/publication?articleId=",