Utilities for managing Google plugins (Maps & Tag Manager) in Baloise web applications.
npm i @baloise/web-app-google-utils
Class BalGoogleMaps
to load the Google Maps script into your application.
- Version of Google Maps that you want to load
- API Key for Google Maps
// Initialize once
BalGoogleMaps.load({version: 'your-version', apiKey: 'your-api-key'});
Class BalGoogleTagManager
to load the GTM script and handle the events. At the moment only click is supported.
- API Key for Google Tag Manager
- Name of your application
// Initialize once
const gtm = new BalGoogleTagManager();
gtm.load({
applicationName: 'your-app-name',
apiKey: 'your-api-key'
});
// Send an event
gtm.sendClickEvent('your-event');