@firestitch/analytics
Advanced tools
Comparing version 12.1.0 to 12.2.0
@@ -0,0 +0,0 @@ import { ElementRef, OnDestroy, OnInit } from '@angular/core'; |
export * from './analytics.directive'; |
@@ -0,0 +0,0 @@ import { ModuleWithProviders } from '@angular/core'; |
import { InjectionToken } from '@angular/core'; | ||
export declare const FS_ANALYTICS_CONFIG: InjectionToken<any>; |
export * from './analytics-config.injector'; |
@@ -5,2 +5,5 @@ export interface FsAnalyticsConfig { | ||
}; | ||
googleTags?: { | ||
containerId: string; | ||
}; | ||
facebookPixel?: { | ||
@@ -7,0 +10,0 @@ pixelId: string; |
export * from './analytics-config'; |
@@ -0,0 +0,0 @@ import { Provider } from "./provider"; |
@@ -6,3 +6,3 @@ import { Provider } from "./provider"; | ||
trackEvent(action: any, value?: any, options?: any): void; | ||
get trackingId(): string; | ||
get measurementId(): string; | ||
} |
@@ -0,0 +0,0 @@ import { Injector } from "@angular/core"; |
@@ -0,0 +0,0 @@ import { Injector } from '@angular/core'; |
@@ -449,4 +449,4 @@ (function (global, factory) { | ||
var _this = this; | ||
if (this.trackingId) { | ||
this.addScript("https://www.googletagmanager.com/gtag/js?id=" + this.trackingId); | ||
if (this.measurementId) { | ||
this.addScript("https://www.googletagmanager.com/gtag/js?id=" + this.measurementId); | ||
this.window.dataLayer = this.window.dataLayer || []; | ||
@@ -457,3 +457,3 @@ this.window.gtag = function () { | ||
gtag('js', new Date()); | ||
gtag('config', this.trackingId, { path_path: this._router.url }); | ||
gtag('config', this.measurementId, { path_path: this._router.url }); | ||
this._router.events.pipe(operators.skip(1), operators.filter(function (event) { return event instanceof i1.NavigationEnd; })) | ||
@@ -463,3 +463,3 @@ .subscribe(function (event) { | ||
page_path: event.urlAfterRedirects, | ||
send_to: _this.trackingId | ||
send_to: _this.measurementId | ||
}); | ||
@@ -480,3 +480,3 @@ }); | ||
}; | ||
Object.defineProperty(GoogleAnalyticsProvider.prototype, "trackingId", { | ||
Object.defineProperty(GoogleAnalyticsProvider.prototype, "measurementId", { | ||
get: function () { | ||
@@ -492,2 +492,54 @@ var _a; | ||
var GoogleTagsProvider = /** @class */ (function (_super) { | ||
__extends(GoogleTagsProvider, _super); | ||
function GoogleTagsProvider() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
GoogleTagsProvider.prototype.init = function () { | ||
var _this = this; | ||
if (this.containerId) { | ||
this.addScript("https://www.googletagmanager.com/gtm.js?id=" + this.containerId); | ||
this.window.dataLayer = this.window.dataLayer || []; | ||
this.window.gtag = function (event, action, options) { | ||
if (event === 'event') { | ||
var payload = Object.assign({ 'event': action }, options); | ||
window.dataLayer.push(payload); | ||
} | ||
else { | ||
window.dataLayer.push(arguments); | ||
} | ||
}; | ||
gtag('js', new Date()); | ||
gtag('config', this.containerId, { path_path: this._router.url }); | ||
this._router.events.pipe(operators.skip(1), operators.filter(function (event) { return event instanceof i1.NavigationEnd; })) | ||
.subscribe(function (event) { | ||
gtag('event', 'page_view', { | ||
page_path: event.urlAfterRedirects, | ||
send_to: _this.containerId | ||
}); | ||
}); | ||
} | ||
}; | ||
GoogleTagsProvider.prototype.gtag = function (name, value, options) { | ||
if (options === void 0) { options = {}; } | ||
this.window.gtag(name, value, options); | ||
}; | ||
GoogleTagsProvider.prototype.trackEvent = function (action, value, options) { | ||
this.gtag('event', action, { | ||
'event_category': options === null || options === void 0 ? void 0 : options.category, | ||
'event_label': options === null || options === void 0 ? void 0 : options.label, | ||
'value': value | ||
}); | ||
}; | ||
Object.defineProperty(GoogleTagsProvider.prototype, "containerId", { | ||
get: function () { | ||
var _a; | ||
return (_a = this._config.googleTags) === null || _a === void 0 ? void 0 : _a.containerId; | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
return GoogleTagsProvider; | ||
}(Provider)); | ||
var FS_ANALYTICS_CONFIG = new i0.InjectionToken('fs-analytics-config'); | ||
@@ -506,2 +558,5 @@ | ||
} | ||
if (this._config.googleTags) { | ||
this._providers.push(new GoogleTagsProvider(this._injector, this._config, this._router)); | ||
} | ||
if (this._config.facebookPixel) { | ||
@@ -508,0 +563,0 @@ this._providers.push(new FacebookPixelProvider(this._injector, this._config, this._router)); |
@@ -40,2 +40,2 @@ import { Directive, ElementRef, Input } from '@angular/core'; | ||
}] } }); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5hbHl0aWNzLmRpcmVjdGl2ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9hcHAvZGlyZWN0aXZlcy9hbmFseXRpY3MvYW5hbHl0aWNzLmRpcmVjdGl2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLFVBQVUsRUFBRSxLQUFLLEVBQXFCLE1BQU0sZUFBZSxDQUFDO0FBRWhGLE9BQU8sRUFBRSxTQUFTLEVBQUUsT0FBTyxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBQzFDLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUUzQyxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sa0NBQWtDLENBQUM7OztBQU0vRCxNQUFNLE9BQU8sb0JBQW9CO0lBTy9CLFlBQ1UsVUFBdUIsRUFDdkIsR0FBZTtRQURmLGVBQVUsR0FBVixVQUFVLENBQWE7UUFDdkIsUUFBRyxHQUFILEdBQUcsQ0FBWTtRQVBJLFdBQU0sR0FBRyxFQUFFLENBQUM7UUFDekIsVUFBSyxHQUFHLE9BQU8sQ0FBQztRQUV4QixjQUFTLEdBQUcsSUFBSSxPQUFPLEVBQUUsQ0FBQztJQUsvQixDQUFDO0lBRUcsUUFBUTtRQUNiLFNBQVMsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLGFBQWEsRUFBRSxJQUFJLENBQUMsS0FBSyxDQUFDO2FBQzVDLElBQUksQ0FDSCxTQUFTLENB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uYWx5dGljcy50cmFja0V2ZW50KHRoaXMuYWN0aW9uKTtcbiAgICB9KTtcbiAgfVxuXG4gIHB1YmxpYyBuZ09uRGVzdHJveSgpOiB2b2lkIHtcbiAgICB0aGlzLl9kZXN0cm95JC5uZXh0KG51bGwpO1xuICAgIHRoaXMuX2Rlc3Ryb3kkLmNvbXBsZXRlKCk7XG4gIH1cbn1cbiJdfQ== |
export * from './analytics.directive'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvYXBwL2RpcmVjdGl2ZXMvYW5hbHl0aWNzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsdUJBQXVCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2FuYWx5dGljcy5kaXJlY3RpdmUnO1xuIl19 |
@@ -0,0 +0,0 @@ import { NgModule } from '@angular/core'; |
import { InjectionToken } from '@angular/core'; | ||
export const FS_ANALYTICS_CONFIG = new InjectionToken('fs-analytics-config'); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5hbHl0aWNzLWNvbmZpZy5pbmplY3Rvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9hcHAvaW5qZWN0b3JzL2FuYWx5dGljcy1jb25maWcuaW5qZWN0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUUvQyxNQUFNLENBQUMsTUFBTSxtQkFBbUIsR0FBRyxJQUFJLGNBQWMsQ0FBTSxxQkFBcUIsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSW5qZWN0aW9uVG9rZW4gfSBmcm9tICdAYW5ndWxhci9jb3JlJztcblxuZXhwb3J0IGNvbnN0IEZTX0FOQUxZVElDU19DT05GSUcgPSBuZXcgSW5qZWN0aW9uVG9rZW48YW55PignZnMtYW5hbHl0aWNzLWNvbmZpZycpO1xuIl19 |
export * from './analytics-config.injector'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvYXBwL2luamVjdG9ycy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLDZCQUE2QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9hbmFseXRpY3MtY29uZmlnLmluamVjdG9yJztcbiJdfQ== |
export {}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5hbHl0aWNzLWNvbmZpZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9hcHAvaW50ZXJmYWNlcy9hbmFseXRpY3MtY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIEZzQW5hbHl0aWNzQ29uZmlnIHtcbiAgZ29vZ2xlQW5hbHl0aWNzPzoge1xuICAgIG1lYXN1cmVtZW50SWQ6IHN0cmluZyxcbiAgfSxcbiAgZmFjZWJvb2tQaXhlbD86IHtcbiAgICBwaXhlbElkOiBzdHJpbmcsXG4gIH1cbn0iXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5hbHl0aWNzLWNvbmZpZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9hcHAvaW50ZXJmYWNlcy9hbmFseXRpY3MtY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIEZzQW5hbHl0aWNzQ29uZmlnIHtcbiAgZ29vZ2xlQW5hbHl0aWNzPzoge1xuICAgIG1lYXN1cmVtZW50SWQ6IHN0cmluZyxcbiAgfSxcbiAgZ29vZ2xlVGFncz86IHtcbiAgICBjb250YWluZXJJZDogc3RyaW5nLFxuICB9LFxuICBmYWNlYm9va1BpeGVsPzoge1xuICAgIHBpeGVsSWQ6IHN0cmluZyxcbiAgfVxufVxuIl19 |
export * from './analytics-config'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvYXBwL2ludGVyZmFjZXMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxvQkFBb0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vYW5hbHl0aWNzLWNvbmZpZyc7Il19 |
@@ -49,2 +49,2 @@ import { Provider } from "./provider"; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFjZWJvb2stcGl4ZWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvYXBwL3Byb3ZpZGVycy9mYWNlYm9vay1waXhlbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sWUFBWSxDQUFDO0FBRXRDLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxnQkFBZ0IsQ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czovL2Nvbm5lY3QuZmFjZWJvb2submV0L2VuX1VTL2ZiZXZlbnRzLmpzYCwgb25sb2FkKTtcbiAgfVxuXG4gIHB1YmxpYyBhZGRJbWcoKTogdm9pZCB7XG4gICAgdmFyIGltZyA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2ltZycpO1xuICAgIGltZy5zZXRBdHRyaWJ1dGUoJ2hlaWdodCcsJzEnKTtcbiAgICBpbWcuc2V0QXR0cmlidXRlKCd3aWR0aCcsJzEnKTtcbiAgICBpbWcuc2V0QXR0cmlidXRlKCdzdHlsZScsJ2Rpc3BsYXk6bm9uZScpO1xuICAgIGltZy5zZXRBdHRyaWJ1dGUoJ3NyYycsYGh0dHBzOi8vd3d3LmZhY2Vib29rLmNvbS90cj9pZD0ke3RoaXMucGl4ZWxJZH0mZXY9UGFnZVZpZXcmbm9zY3JpcHQ9MWApO1xuICAgIHZhciBub3NjcmlwdCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ25vc2NyaXB0Jyk7XG4gICAgbm9zY3JpcHQuYXBwZW5kKGltZyk7XG4gICAgdGhpcy5hcHBlbmRIZWFkKG5vc2NyaXB0KTtcbiAgfVxuXG4gIHB1YmxpYyBnZXQgcGl4ZWxJZCgpIHtcbiAgICByZXR1cm4gdGhpcy5fY29uZmlnLmZhY2Vib29rUGl4ZWw/LnBpeGVsSWQ7XG4gIH1cbn0iXX0= |
@@ -6,4 +6,4 @@ import { Provider } from "./provider"; | ||
init() { | ||
if (this.trackingId) { | ||
this.addScript(`https://www.googletagmanager.com/gtag/js?id=${this.trackingId}`); | ||
if (this.measurementId) { | ||
this.addScript(`https://www.googletagmanager.com/gtag/js?id=${this.measurementId}`); | ||
this.window.dataLayer = this.window.dataLayer || []; | ||
@@ -14,3 +14,3 @@ this.window.gtag = function () { | ||
gtag('js', new Date()); | ||
gtag('config', this.trackingId, { path_path: this._router.url }); | ||
gtag('config', this.measurementId, { path_path: this._router.url }); | ||
this._router.events.pipe(skip(1), filter(event => event instanceof NavigationEnd)) | ||
@@ -20,3 +20,3 @@ .subscribe((event) => { | ||
page_path: event.urlAfterRedirects, | ||
send_to: this.trackingId | ||
send_to: this.measurementId | ||
}); | ||
@@ -36,3 +36,3 @@ }); | ||
} | ||
get trackingId() { | ||
get measurementId() { | ||
var _a; | ||
@@ -42,2 +42,2 @@ return (_a = this._config.googleAnalytics) === null || _a === void 0 ? void 0 : _a.measurementId; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ29vZ2xlLWFuYWx5dGljcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9hcHAvcHJvdmlkZXJzL2dvb2dsZS1hbmFseXRpY3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLFlBQVksQ0FBQztBQUV0QyxPQUFPLEVBQUUsTUFBTSxFQUFFLElBQUksRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQzlDLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUtoRCxNQUFNLE9BQU8sdUJBQXdCLFNBQVEsUUFBUTtJQUU1QyxJQUFJO1FBQ1QsSUFBRyxJQUFJLENBQUMsVUFBVSxFQUFFO1lBQ2xCLElBQUksQ0FBQyxTQUFTLENBQUMsK0NBQStDLElBQUksQ0FBQyxVQUFVLEVBQUUsQ0FBQyxDQUFDO1lBRWpGLElBQUksQ0FBQyxNQUFNLENBQUMsU0FBUyxHQUFHLElBQUksQ0FBQyxNQUFNLENBQUMsU0FBUyxJQUFJLEVBQUUsQ0FBQztZQUNwRCxJQUFJLENBQUMsTUFBTSxDQUFDLElBQUksR0FBRztnQkFDaEIsTUFBYyxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsU0FBUyxDQUFDLENBQUM7WUFDNUMsQ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BZnRlclJlZGlyZWN0cyxcbiAgICAgICAgICBzZW5kX3RvOiB0aGlzLm1lYXN1cmVtZW50SWRcbiAgICAgICAgfSlcbiAgICAgIH0pO1xuICAgIH1cbiAgfVxuXG4gIHB1YmxpYyBndGFnKG5hbWUsIHZhbHVlLCBvcHRpb25zID0ge30pIHtcbiAgICB0aGlzLndpbmRvdy5ndGFnKG5hbWUsIHZhbHVlLCBvcHRpb25zKTtcbiAgfVxuXG4gIHB1YmxpYyB0cmFja0V2ZW50KGFjdGlvbjogYW55LCB2YWx1ZT8sIG9wdGlvbnM/KTogdm9pZCB7XG4gICAgdGhpcy5ndGFnKCdldmVudCcsIGFjdGlvbiwge1xuICAgICAgJ2V2ZW50X2NhdGVnb3J5Jzogb3B0aW9ucz8uY2F0ZWdvcnksXG4gICAgICAnZXZlbnRfbGFiZWwnOiBvcHRpb25zPy5sYWJlbCxcbiAgICAgICd2YWx1ZSc6IHZhbHVlXG4gICAgfSk7XG4gIH1cblxuICBwdWJsaWMgZ2V0IG1lYXN1cmVtZW50SWQoKSB7XG4gICAgcmV0dXJuIHRoaXMuX2NvbmZpZy5nb29nbGVBbmFseXRpY3M/Lm1lYXN1cmVtZW50SWQ7XG4gIH1cbn0iXX0= |
@@ -0,0 +0,0 @@ export class Provider { |
@@ -5,2 +5,3 @@ import { Inject, Injectable, Injector } from '@angular/core'; | ||
import { GoogleAnalyticsProvider } from '../providers/google-analytics'; | ||
import { GoogleTagsProvider } from '../providers/google-tags'; | ||
import { FS_ANALYTICS_CONFIG } from '../injectors'; | ||
@@ -20,2 +21,5 @@ import * as i0 from "@angular/core"; | ||
} | ||
if (this._config.googleTags) { | ||
this._providers.push(new GoogleTagsProvider(this._injector, this._config, this._router)); | ||
} | ||
if (this._config.facebookPixel) { | ||
@@ -45,2 +49,2 @@ this._providers.push(new FacebookPixelProvider(this._injector, this._config, this._router)); | ||
}] }, { type: i0.Injector }, { type: i1.Router }]; } }); | ||
//# sourceMappingURL=data:application/json;base64,eyJ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KGFjdGlvbiwgZGF0YSk7XG4gICAgfSk7XG4gIH1cbn1cbiJdfQ== |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ export { FsAnalyticsModule } from './app/fs-analytics.module'; |
@@ -81,4 +81,4 @@ import * as i0 from '@angular/core'; | ||
init() { | ||
if (this.trackingId) { | ||
this.addScript(`https://www.googletagmanager.com/gtag/js?id=${this.trackingId}`); | ||
if (this.measurementId) { | ||
this.addScript(`https://www.googletagmanager.com/gtag/js?id=${this.measurementId}`); | ||
this.window.dataLayer = this.window.dataLayer || []; | ||
@@ -89,3 +89,3 @@ this.window.gtag = function () { | ||
gtag('js', new Date()); | ||
gtag('config', this.trackingId, { path_path: this._router.url }); | ||
gtag('config', this.measurementId, { path_path: this._router.url }); | ||
this._router.events.pipe(skip(1), filter(event => event instanceof NavigationEnd)) | ||
@@ -95,3 +95,3 @@ .subscribe((event) => { | ||
page_path: event.urlAfterRedirects, | ||
send_to: this.trackingId | ||
send_to: this.measurementId | ||
}); | ||
@@ -111,3 +111,3 @@ }); | ||
} | ||
get trackingId() { | ||
get measurementId() { | ||
var _a; | ||
@@ -118,2 +118,43 @@ return (_a = this._config.googleAnalytics) === null || _a === void 0 ? void 0 : _a.measurementId; | ||
class GoogleTagsProvider extends Provider { | ||
init() { | ||
if (this.containerId) { | ||
this.addScript(`https://www.googletagmanager.com/gtm.js?id=${this.containerId}`); | ||
this.window.dataLayer = this.window.dataLayer || []; | ||
this.window.gtag = function (event, action, options) { | ||
if (event === 'event') { | ||
const payload = Object.assign({ 'event': action }, options); | ||
window.dataLayer.push(payload); | ||
} | ||
else { | ||
window.dataLayer.push(arguments); | ||
} | ||
}; | ||
gtag('js', new Date()); | ||
gtag('config', this.containerId, { path_path: this._router.url }); | ||
this._router.events.pipe(skip(1), filter(event => event instanceof NavigationEnd)) | ||
.subscribe((event) => { | ||
gtag('event', 'page_view', { | ||
page_path: event.urlAfterRedirects, | ||
send_to: this.containerId | ||
}); | ||
}); | ||
} | ||
} | ||
gtag(name, value, options = {}) { | ||
this.window.gtag(name, value, options); | ||
} | ||
trackEvent(action, value, options) { | ||
this.gtag('event', action, { | ||
'event_category': options === null || options === void 0 ? void 0 : options.category, | ||
'event_label': options === null || options === void 0 ? void 0 : options.label, | ||
'value': value | ||
}); | ||
} | ||
get containerId() { | ||
var _a; | ||
return (_a = this._config.googleTags) === null || _a === void 0 ? void 0 : _a.containerId; | ||
} | ||
} | ||
const FS_ANALYTICS_CONFIG = new InjectionToken('fs-analytics-config'); | ||
@@ -132,2 +173,5 @@ | ||
} | ||
if (this._config.googleTags) { | ||
this._providers.push(new GoogleTagsProvider(this._injector, this._config, this._router)); | ||
} | ||
if (this._config.facebookPixel) { | ||
@@ -134,0 +178,0 @@ this._providers.push(new FacebookPixelProvider(this._injector, this._config, this._router)); |
@@ -0,0 +0,0 @@ /** |
{ | ||
"name": "@firestitch/analytics", | ||
"version": "12.1.0", | ||
"version": "12.2.0", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
@@ -0,0 +0,0 @@ export { FsAnalyticsModule } from './app/fs-analytics.module'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Possible typosquat attack
Supply chain riskThere is a package with a similar name that is downloaded much more often.
Did you mean |
---|
@firebase/analytics |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
153527
34
1267
1
1