From 1079562214d8a944cd4c0f1b81c33e8a2fe4f025 Mon Sep 17 00:00:00 2001 From: Thomas Fuchs Date: Thu, 12 Jan 2017 18:17:43 +0100 Subject: [PATCH] angular-google-analytics: Update API since release 1.1.0 (#13958) * New methods * angular-google-analytics: Fix typo in extended interface * Missunderstanding of Definitions format --- .../angular-google-analytics-tests.ts | 4 +-- angular-google-analytics/index.d.ts | 28 +++++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/angular-google-analytics/angular-google-analytics-tests.ts b/angular-google-analytics/angular-google-analytics-tests.ts index 42c7e1506c..3ca8c7941c 100644 --- a/angular-google-analytics/angular-google-analytics-tests.ts +++ b/angular-google-analytics/angular-google-analytics-tests.ts @@ -58,8 +58,8 @@ function RetrieveCurrentURL(Analytics: angular.google.analytics.AnalyticsService } function ManualScriptTagInjection(Analytics: angular.google.analytics.AnalyticsService) { - Analytics.createScriptTag(); - Analytics.createAnalyticsScriptTag(); + Analytics.registerScriptTags(); + Analytics.registerTrackers(); } function SetCustomDimensions(Analytics: angular.google.analytics.AnalyticsService) { diff --git a/angular-google-analytics/index.d.ts b/angular-google-analytics/index.d.ts index d83753a7b7..51a2d7eb7e 100644 --- a/angular-google-analytics/index.d.ts +++ b/angular-google-analytics/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for angular-google-analytics v1.1.0 +// Type definitions for angular-google-analytics v1.1.8 // Project: https://github.com/revolunet/angular-google-analytics -// Definitions by: Cyril Schumacher +// Definitions by: Cyril Schumacher , Thomas Fuchs // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -24,6 +24,18 @@ declare module 'angular' { * All calls queued to the offlineQueue are not outbound calls yet and hence do not show up in the log. */ offlineQueue: Array; + + /** + * @summary If delayScriptTag(true) was set during configuration then manual script tag injection is required. + * @return {boolean} True if scripts were registered. + */ + registerScriptTags(): boolean; + + /** + * @summary If delayScriptTag(true) was set during configuration then manual tracker setup is required. + * @return {boolean} True if trackers were registered. + */ + registerTrackers(): boolean; /** * @summary Returns the current URL that would be sent if a `trackPage` call was made. @@ -166,6 +178,18 @@ declare module 'angular' { * @param {RegExp} regex The regex. */ setRemoveRegExp(regex: RegExp): AnalyticsProvider; + + /** + * @summary Activate reading custom tracking urls from $routeProvider config (default is false) + * This is more flexible than using RegExp and easier to maintain for multiple parameters. + * It also reduces tracked pages to routes (only those with a templateUrl) defined in the + * $routeProvider and therefore reduces bounce rate created by redirects. + * See https://github.com/revolunet/angular-google-analytics#set-route-tracking-behaviors for details + * @param {boolean} val If true, the module tries to read tracking information from the + * $routeProvider config. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + */ + readFromRoute(useRoute: boolean): AnalyticsProvider; /** * @summary Starts the offline mode.