本文整理匯總了TypeScript中ionic-native.GoogleAnalytics.trackEvent方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript GoogleAnalytics.trackEvent方法的具體用法?TypeScript GoogleAnalytics.trackEvent怎麽用?TypeScript GoogleAnalytics.trackEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ionic-native.GoogleAnalytics
的用法示例。
在下文中一共展示了GoogleAnalytics.trackEvent方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: trackEvent
trackEvent(category, action) {
if (window['cordova']) {
this.initID();
GoogleAnalytics.trackEvent(category, action);
} else {
/* tslint:disable */
console.log("Analytics Event: " + category + " Action: " + action);
/* tslint:enable */
}
}
示例2: trackEvent
/**
* Track an event
* @param {string} category
* @param {string} action
* @param {string} label
* @param {number} value
*
* @static
* @returns {Promise<void>}
*/
public static trackEvent(category: string, action: string, label?: string, value?: number): Promise<void> {
return GoogleAnalytics.trackEvent(category, action, label, value)
.then(console.log, console.error);
}
示例3:
this.platform.ready().then(() => {
GoogleAnalytics.trackEvent(data.category, data.action, data.label, data.value);
});
示例4:
this.platform.ready().then(() => {
GoogleAnalytics.trackEvent(category, action, label, value);
});
示例5:
this.platform.ready().then(() => {
GoogleAnalytics.trackEvent("Page", "HomePage-Open-Action", "Label", 1);
});