Merge pull request #4704 from mempool/mononaut/matomo-events
matomo events
This commit is contained in:
		
						commit
						e8e43c074b
					
				| @ -26,6 +26,7 @@ import { RelativeUrlPipe } from '../../shared/pipes/relative-url/relative-url.pi | |||||||
| import { Price, PriceService } from '../../services/price.service'; | import { Price, PriceService } from '../../services/price.service'; | ||||||
| import { isFeatureActive } from '../../bitcoin.utils'; | import { isFeatureActive } from '../../bitcoin.utils'; | ||||||
| import { ServicesApiServices } from '../../services/services-api.service'; | import { ServicesApiServices } from '../../services/services-api.service'; | ||||||
|  | import { EnterpriseService } from '../../services/enterprise.service'; | ||||||
| 
 | 
 | ||||||
| @Component({ | @Component({ | ||||||
|   selector: 'app-transaction', |   selector: 'app-transaction', | ||||||
| @ -116,12 +117,15 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { | |||||||
|     private servicesApiService: ServicesApiServices, |     private servicesApiService: ServicesApiServices, | ||||||
|     private seoService: SeoService, |     private seoService: SeoService, | ||||||
|     private priceService: PriceService, |     private priceService: PriceService, | ||||||
|     private storageService: StorageService |     private storageService: StorageService, | ||||||
|  |     private enterpriseService: EnterpriseService, | ||||||
|   ) {} |   ) {} | ||||||
| 
 | 
 | ||||||
|   ngOnInit() { |   ngOnInit() { | ||||||
|     this.acceleratorAvailable = this.stateService.env.OFFICIAL_MEMPOOL_SPACE && this.stateService.env.ACCELERATOR && this.stateService.network === ''; |     this.acceleratorAvailable = this.stateService.env.OFFICIAL_MEMPOOL_SPACE && this.stateService.env.ACCELERATOR && this.stateService.network === ''; | ||||||
| 
 | 
 | ||||||
|  |     this.enterpriseService.page(); | ||||||
|  | 
 | ||||||
|     this.websocketService.want(['blocks', 'mempool-blocks']); |     this.websocketService.want(['blocks', 'mempool-blocks']); | ||||||
|     this.stateService.networkChanged$.subscribe( |     this.stateService.networkChanged$.subscribe( | ||||||
|       (network) => { |       (network) => { | ||||||
| @ -527,6 +531,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { | |||||||
|     if (!this.txId) { |     if (!this.txId) { | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
|  |     this.enterpriseService.goal(8); | ||||||
|     this.showAccelerationSummary = true && this.acceleratorAvailable; |     this.showAccelerationSummary = true && this.acceleratorAvailable; | ||||||
|     this.scrollIntoAccelPreview = !this.scrollIntoAccelPreview; |     this.scrollIntoAccelPreview = !this.scrollIntoAccelPreview; | ||||||
|     return false; |     return false; | ||||||
|  | |||||||
| @ -139,6 +139,14 @@ export class EnterpriseService { | |||||||
|     this.getMatomo()?.trackGoal(id); |     this.getMatomo()?.trackGoal(id); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   page() { | ||||||
|  |     const matomo = this.getMatomo(); | ||||||
|  |     if (matomo) { | ||||||
|  |       matomo.setCustomUrl(this.getCustomUrl()); | ||||||
|  |       matomo.trackPageView(); | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   private getCustomUrl(): string { |   private getCustomUrl(): string { | ||||||
|     let url = window.location.origin + '/'; |     let url = window.location.origin + '/'; | ||||||
|     let route = this.activatedRoute; |     let route = this.activatedRoute; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user