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>`
selector: 'openaire-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,15 +1,16 @@
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 {
constructor() {
piwikSiteId = properties.piwikSiteId;
constructor() {
}
public ngOnInit() {}

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',
@ -88,15 +90,20 @@ import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
styleUrls: ['develop.component.css']
})
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();
@ -123,6 +133,6 @@ export class DevelopComponent implements OnInit {
private navigateToError() {
this._router.navigate(['/error'], {queryParams: {'page': this._router.url}});
}
}

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,12 +1,15 @@
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() {}
ngOnInit() {

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,
@ -41,23 +41,23 @@ export let properties: EnvProperties = {
helpdesk: "https://www.openaire.eu/support/helpdesk",
helpdeskEmail: "helpdesk@openaire.eu",
utilsService: "https://demo.openaire.eu/utils-service",
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=",
logoutUrl: "https://beta.services.openaire.eu/explore-login/openid_logout",
cookieDomain: ".openaire.eu",
feedbackmail: "feedback@openaire.eu",
cacheUrl: "https://demo.openaire.eu/cache/get?url=",
datasourcesAPI: "https://beta.services.openaire.eu/openaire/ds/search/",
adminToolsCommunity: "aggregator",
@ -65,14 +65,14 @@ export let properties: EnvProperties = {
useHelpTexts: false,
contextsAPI: "https://beta.services.openaire.eu/openaire/context",
communityAPI: "https://beta.services.openaire.eu/openaire/community/",
csvLimit: 2000,
pagingLimit: 20,
resultsPerPage: 10,
"baseLink" : "",
"domain":"https://beta.explore.openaire.eu",
"domain":"https://beta.canada.explore.openaire.eu",
searchLinkToResult: "/search/result?id=",
searchLinkToPublication: "/search/publication?articleId=",
searchLinkToProject: "/search/project?projectId=",
@ -81,7 +81,7 @@ export let properties: EnvProperties = {
searchLinkToSoftwareLanding: "/search/software?softwareId=",
searchLinkToOrp: "/search/other?orpId=",
searchLinkToOrganization: "/search/organization?organizationId=",
searchLinkToPublications: "/search/find/publications",
searchLinkToDataProviders: "/search/find/dataproviders",
searchLinkToProjects: "/search/find/projects",
@ -95,7 +95,7 @@ export let properties: EnvProperties = {
searchLinkToJournals: "/search/journals",
searchLinkToJournalsTable: "/search/journals-table",
searchLinkToResults: "/search/find/research-outcomes",
searchLinkToAdvancedPublications: "/search/advanced/publications",
searchLinkToAdvancedProjects: "/search/advanced/projects",
searchLinkToAdvancedDatasets: "/search/advanced/datasets",
@ -104,14 +104,14 @@ export let properties: EnvProperties = {
searchLinkToAdvancedDataProviders: "/search/advanced/dataproviders",
searchLinkToAdvancedOrganizations: "/search/advanced/organizations",
searchLinkToAdvancedResults: "/search/advanced/research-outcomes",
lastIndexInformationLink: "https://beta.openaire.eu/aggregation-and-content-provision-workflows",
showLastIndexInformationLink: true,
widgetLink: "https://beta.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=",
claimsInformationLink: "https://beta.openaire.eu/linking",
lastIndexUpdate: "2020-05-11",
indexInfoAPI: "https://beta.services.openaire.eu/openaire/info/",
depositLearnHowPage: "/participate/deposit/learn-how",
depositSearchPage: "/participate/deposit/search",
altMetricsAPIURL: "https://api.altmetric.com/v1/doi/",

View File

@ -41,40 +41,40 @@ export let properties: EnvProperties = {
helpdesk: "https://www.openaire.eu/support/helpdesk",
helpdeskEmail: "helpdesk@openaire.eu",
utilsService: "https://explore.openaire.eu/utils-service",
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=",
logoutUrl: "https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=",
cookieDomain: ".openaire.eu",
feedbackmail: "feedback@openaire.eu",
cacheUrl: "https://explore.openaire.eu/cache/get?url=",
datasourcesAPI: "https://services.openaire.eu/openaire/ds/search/",
adminToolsCommunity: "aggregator",
adminToolsAPIURL: "https://services.openaire.eu/uoa-admin-tools/",
useHelpTexts:false,
contextsAPI: "https://services.openaire.eu/openaire/context",
communityAPI: "https://services.openaire.eu/openaire/community/",
csvLimit: 2000,
pagingLimit: 20,
resultsPerPage: 10,
"baseLink" : "/",
"domain": "https://explore.openaire.eu",
"domain": "https://canada.explore.openaire.eu",
searchLinkToResult: "/search/result?id=",
searchLinkToPublication: "/search/publication?articleId=",
searchLinkToProject: "/search/project?projectId=",
@ -83,7 +83,7 @@ export let properties: EnvProperties = {
searchLinkToSoftwareLanding: "/search/software?softwareId=",
searchLinkToOrp: "/search/other?orpId=",
searchLinkToOrganization: "/search/organization?organizationId=",
searchLinkToPublications: "/search/find/publications",
searchLinkToDataProviders: "/search/find/dataproviders",
searchLinkToProjects: "/search/find/projects",
@ -97,7 +97,7 @@ export let properties: EnvProperties = {
searchLinkToJournals: "/search/journals",
searchLinkToJournalsTable: "/search/journals-table",
searchLinkToResults: "/search/find/research-outcomes",
searchLinkToAdvancedPublications: "/search/advanced/publications",
searchLinkToAdvancedProjects: "/search/advanced/projects",
searchLinkToAdvancedDatasets: "/search/advanced/datasets",
@ -106,14 +106,14 @@ export let properties: EnvProperties = {
searchLinkToAdvancedDataProviders: "/search/advanced/dataproviders",
searchLinkToAdvancedOrganizations: "/search/advanced/organizations",
searchLinkToAdvancedResults: "/search/advanced/research-outcomes",
lastIndexInformationLink: "https://www.openaire.eu/aggregation-and-content-provision-workflows",
showLastIndexInformationLink: true,
widgetLink: "https://www.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=",
claimsInformationLink: "https://www.openaire.eu/linking",
lastIndexUpdate: "2020-06-15",
indexInfoAPI: "https://services.openaire.eu/openaire/info/",
depositLearnHowPage: "/participate/deposit/learn-how",
depositSearchPage: "/participate/deposit/search",
altMetricsAPIURL: "https://api.altmetric.com/v1/doi/",