Skip to content

Commit

Permalink
Merge pull request #7 from baloise/gtm-custom-event
Browse files Browse the repository at this point in the history
feat(gtm): add custom event for GTM service
  • Loading branch information
yannickholzenkamp committed Nov 20, 2023
2 parents 18e31f5 + eb8e5d9 commit 6ca51e8
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 6ca51e8

Please sign in to comment.