Skip to content

Commit

Permalink
fix: ga4 events
Browse files Browse the repository at this point in the history
  • Loading branch information
adekbadek committed Mar 19, 2024
1 parent 9a6cc39 commit 11ca3b8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/view/analytics/clicked.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import { getEventPayload, getRawId, sendEvent } from '../utils';

export const manageClickedEvents = prompts => {
prompts.forEach( prompt => {
const anchorLinks = [
...prompt.querySelectorAll( '.newspack-inline-popup a, .newspack-popup__content a' ),
];
const anchorLinks = [ ...prompt.querySelectorAll( '.newspack-popup-container a' ) ];
const handleEvent = e => {
const extraParams = {};

Expand Down
2 changes: 1 addition & 1 deletion src/view/analytics/dismissed.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getEventPayload, getRawId, sendEvent } from '../utils';
export const manageDismissals = prompts => {
prompts.forEach( prompt => {
const closeButton = prompt.querySelector( '.newspack-lightbox__close' );
const forms = [ ...prompt.querySelectorAll( '.newspack-popup__content form' ) ];
const forms = [ ...prompt.querySelectorAll( '.newspack-popup-container form' ) ];
if ( closeButton ) {
const handleEvent = () => {
const payload = getEventPayload( 'dismissed', getRawId( prompt.getAttribute( 'id' ) ) );
Expand Down
4 changes: 1 addition & 3 deletions src/view/analytics/submitted.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import { getEventPayload, getRawId, sendEvent } from '../utils';

export const manageFormSubmissions = prompts => {
prompts.forEach( prompt => {
const forms = [
...prompt.querySelectorAll( '.newspack-popup__content form, .newspack-inline-popup form' ),
];
const forms = [ ...prompt.querySelectorAll( '.newspack-popup-container form' ) ];
const handleEvent = () => {
const payload = getEventPayload( 'form_submission', getRawId( prompt.getAttribute( 'id' ) ) );
sendEvent( payload );
Expand Down

0 comments on commit 11ca3b8

Please sign in to comment.