Skip to content

Commit

Permalink
fix(google-analytics): specify successIndex and errorIndex for method…
Browse files Browse the repository at this point in the history
…s with optional params
  • Loading branch information
ihadeed committed Oct 6, 2016
1 parent 84f54d6 commit 6f23bef
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions src/plugins/googleanalytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ export class GoogleAnalytics {
* @param value {any}
* @return {Promise<any>}
*/
@Cordova()
@Cordova({
successIndex: 2,
errorIndex: 3
})
static trackMetric(key: string, value?: any): Promise<any> { return; }

/**
Expand All @@ -94,14 +97,17 @@ export class GoogleAnalytics {
* @param newSession {boolean} Set to true to create a new session
* @return {Promise<any>}
*/
@Cordova()
@Cordova({
successIndex: 3,
errorIndex: 4
})
static trackView(title: string, campaignUrl?: string, newSession?: boolean): Promise<any> { return; }

/**
* Add a Custom Dimension
* https://developers.google.com/analytics/devguides/platform/customdimsmets
* @param {string} key
* @param {string} value
* @param key {string}
* @param value {string}
* @return {Promise<any>}
*/
@Cordova()
Expand All @@ -117,24 +123,27 @@ export class GoogleAnalytics {
* @param newSession {boolean} Set to true to create a new session
* @return {Promise<any>}
*/
@Cordova()
@Cordova({
successIndex: 5,
errorIndex: 6
})
static trackEvent(category: string, action: string, label?: string, value?: number, newSession?: boolean): Promise<any> { return; }

/**
* Track an exception
* @param {string} description
* @param {boolean} fatal
* @param description {string}
* @param fatal {boolean}
* @return {Promise<any>}
*/
@Cordova()
static trackException(description: string, fatal: boolean): Promise<any> { return; }

/**
* Track User Timing (App Speed)
* @param {string} category
* @param {number} intervalInMilliseconds
* @param {string} variable
* @param {string} label
* @param category {string}
* @param intervalInMilliseconds {number}
* @param variable {string}
* @param label {string}
* @return {Promise<any>}
*/
@Cordova()
Expand All @@ -143,12 +152,12 @@ export class GoogleAnalytics {
/**
* Add a Transaction (Ecommerce)
* https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce#addTrans
* @param {string} id
* @param {string} affiliation
* @param {number} revenue
* @param {number} tax
* @param {number} shipping
* @param {string} currencyCode
* @param id {string}
* @param affiliation {string}
* @param revenue {number}
* @param tax {number}
* @param shipping {number}
* @param currencyCode {string}
* @return {Promise<any>}
*/
@Cordova()
Expand All @@ -171,7 +180,7 @@ export class GoogleAnalytics {

/**
* Enable/disable automatic reporting of uncaught exceptions
* @param {boolean} shouldEnable
* @param shouldEnable {boolean}
* @return {Promise<any>}
*/
@Cordova()
Expand Down

0 comments on commit 6f23bef

Please sign in to comment.