Add tag manager container for link click tracking #6
@@ -1,4 +1,5 @@
|
|||||||
import {AfterContentInit, Component, OnInit} from '@angular/core';
|
import {AfterContentInit, Component, OnInit} from '@angular/core';
|
||||||
|
import { Angulartics2 } from 'angulartics2';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-contact',
|
selector: 'app-contact',
|
||||||
@@ -7,21 +8,34 @@ import {AfterContentInit, Component, OnInit} from '@angular/core';
|
|||||||
})
|
})
|
||||||
export class ContactComponent implements AfterContentInit {
|
export class ContactComponent implements AfterContentInit {
|
||||||
|
|
||||||
constructor() {
|
constructor(private analytics: Angulartics2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterContentInit(): void {
|
ngAfterContentInit(): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
linkedInClicked() {
|
linkedInClicked() {
|
||||||
|
this.analytics.eventTrack.next(this.linkClickEvent('LinkedIn'));
|
||||||
window.open('https://www.linkedin.com/in/cameron-cordes-3b166583/');
|
window.open('https://www.linkedin.com/in/cameron-cordes-3b166583/');
|
||||||
}
|
}
|
||||||
|
|
||||||
githubClicked() {
|
githubClicked() {
|
||||||
|
this.analytics.eventTrack.next(this.linkClickEvent('GitHub'));
|
||||||
window.open('https://github.com/Stampede10343');
|
window.open('https://github.com/Stampede10343');
|
||||||
}
|
}
|
||||||
|
|
||||||
emailClicked() {
|
emailClicked() {
|
||||||
|
this.analytics.eventTrack.next(this.linkClickEvent('Email'));
|
||||||
window.open('mailto:cameronc.dev@gmail.com');
|
window.open('mailto:cameronc.dev@gmail.com');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private linkClickEvent(label: String): object {
|
||||||
|
return {
|
||||||
|
action: 'LinkClick',
|
||||||
|
properties: {
|
||||||
|
category: 'Contact',
|
||||||
|
label: label
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user