Send print parameters to Google Analytics
This commit is contained in:
@@ -109,9 +109,16 @@ class PassMate {
|
|||||||
let print = this.addElement('button', printStep, 'Click here to print the book!');
|
let print = this.addElement('button', printStep, 'Click here to print the book!');
|
||||||
print.style.cursor = 'pointer';
|
print.style.cursor = 'pointer';
|
||||||
printStep.addEventListener('click', () => {
|
printStep.addEventListener('click', () => {
|
||||||
|
let cls = [];
|
||||||
|
for (let cl of this.product.classList) {
|
||||||
|
cls.push(cl);
|
||||||
|
}
|
||||||
|
cls.sort();
|
||||||
|
|
||||||
let gtag = window.gtag || (() => {});
|
let gtag = window.gtag || (() => {});
|
||||||
gtag('event', 'print', {
|
gtag('event', 'print', {
|
||||||
'event_category': 'Overview',
|
'event_category': 'Overview',
|
||||||
|
'event_label': cls.join(' '),
|
||||||
});
|
});
|
||||||
window.print();
|
window.print();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user