mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
Make Google Analytics support correct types for _gaq.push() (#35962)
It seems that `_gaq.push` can accept not only strings, but boolean and numbers as well. This commit fixes the types declarations for it according to the documentation: https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiEventTracking#_trackevent
This commit is contained in:
committed by
Andrew Casey
parent
4d8103200e
commit
9f076daf85
@@ -106,6 +106,9 @@ describe("tester Google Analytics Code _gaq object", () => {
|
||||
_gaq.push(['_gat._anonymizeIp']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
// more details: https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiEventTracking#_trackevent
|
||||
_gaq.push(['_trackEvent', 'category', 'action_name', undefined, undefined, true]);
|
||||
|
||||
_gaq.push(() => {
|
||||
const tracker = _gat._getTrackerByName('UA-65432-1');
|
||||
tracker._trackPageview();
|
||||
|
||||
Vendored
+1
-1
@@ -19,7 +19,7 @@ declare class Tracker {
|
||||
}
|
||||
|
||||
interface GoogleAnalyticsCode {
|
||||
push(commandArray: string[]): void;
|
||||
push(commandArray: Array<string|boolean|number>): void;
|
||||
push(func: Function): void;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user