Comparing version 1.0.0 to 1.0.1
@@ -6,3 +6,3 @@ export interface GtagConfigurationOptions { | ||
/** | ||
* Injects google analytics' gtag lib. | ||
* Injects the google analytics gtag lib. | ||
* @param trackingId The ga tracking id. | ||
@@ -17,3 +17,2 @@ * @param options The options to configure. | ||
export declare function gtag(command: 'set', options: any): void; | ||
export declare function gtag(command: 'event', action: string, options?: any): void; | ||
export declare function gtag(command: 'event', action: 'page_view', options?: { | ||
@@ -28,1 +27,2 @@ page_title?: string; | ||
}): void; | ||
export declare function gtag(command: 'event', action: string, options?: any): void; |
@@ -6,3 +6,3 @@ const anyWindow = window; | ||
/** | ||
* Injects google analytics' gtag lib. | ||
* Injects the google analytics gtag lib. | ||
* @param trackingId The ga tracking id. | ||
@@ -20,4 +20,5 @@ * @param options The options to configure. | ||
const scriptId = 'ga-gtag'; | ||
if (document.getElementById(scriptId)) | ||
if (document.getElementById(scriptId)) { | ||
return; | ||
} | ||
const { head } = document; | ||
@@ -37,3 +38,3 @@ const script = document.createElement('script'); | ||
} | ||
// tslint:enable: unified-signatures | ||
// tslint:enable: unified-signatures, max-line-length | ||
function gtag(arg1, arg2, arg3) { | ||
@@ -40,0 +41,0 @@ anyWindow.dataLayer.push(arguments); |
@@ -12,3 +12,3 @@ (function (global, factory) { | ||
/** | ||
* Injects google analytics' gtag lib. | ||
* Injects the google analytics gtag lib. | ||
* @param trackingId The ga tracking id. | ||
@@ -26,4 +26,5 @@ * @param options The options to configure. | ||
const scriptId = 'ga-gtag'; | ||
if (document.getElementById(scriptId)) | ||
if (document.getElementById(scriptId)) { | ||
return; | ||
} | ||
const { head } = document; | ||
@@ -43,3 +44,3 @@ const script = document.createElement('script'); | ||
} | ||
// tslint:enable: unified-signatures | ||
// tslint:enable: unified-signatures, max-line-length | ||
function gtag(arg1, arg2, arg3) { | ||
@@ -46,0 +47,0 @@ anyWindow.dataLayer.push(arguments); |
{ | ||
"name": "mr-gtag", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Easy, strong typed, and a modern way to use google analytics gtag lib.", | ||
@@ -5,0 +5,0 @@ "main": "dist/umd/index.js", |
7648
114