Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Clean up console.log & passing/spreading of props
Browse files Browse the repository at this point in the history
  • Loading branch information
B77Mills committed Dec 2, 2024
1 parent d690f05 commit 3aa29a9
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default {
overlayDisplayed,
},
};
this.emitP1Event('View');
this.emitP1Event({ action: 'View' });
dataLayer.push(payload);
const { searchParams } = new URL(window.location.href);
if (searchParams.has('idxDebugger')) {
Expand All @@ -70,20 +70,18 @@ export default {
this.EventBus.$on('identity-x-login-link-sent', ({ actionSource }) => {
if (actionSource === 'content_meter_login') {
this.classes.push('login-link-sent');
this.emitP1Event('Submit');
this.emitP1Event({ action: 'Submit' });
}
});
},
methods: {
emitP1Event(action) {
emitP1Event({ action }) {
if (!window.p1events) return;
const { views, remaining, overlayDisplayed } = this;
const label = !overlayDisplayed ? null : 'Gated';
console.log('label: ', label)
window.p1events('track', {
category: 'Content Meter',
action,
...(label && { label }),
...(!overlayDisplayed && { label: 'Gated' }),
props: { n: views },
});
this.EventBus.$emit(`identity-x-content-meter-${action}`, { payload: { views, remaining, overlayDisplayed }});
Expand Down

0 comments on commit 3aa29a9

Please sign in to comment.