Skip to content

Commit

Permalink
feat(gtm): add custom event for GTM service
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickholzenkamp committed Nov 20, 2023
1 parent 18e31f5 commit eb8e5d9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/google-tag-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ export class BalGoogleTagManager {
this.runGtmScript(settings.apiKey);
}
}

// should be avoided

/**
* @deprecated this method should not be used
* @param settings GTM settings for application
*/
public loadForce(settings: GtmSettings): void {
this.runGtmScript(settings.apiKey);
}
Expand All @@ -36,6 +39,12 @@ export class BalGoogleTagManager {
}
};

public sendCustomEvent(event: any): void {
if (event) {
this.googleAnalyticsSendEvent(event);
}
}

/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call */
private runGtmScript(apiKey: string): void {
const w: any = window;
Expand Down

0 comments on commit eb8e5d9

Please sign in to comment.