2013-03-22 26 views
2

我已經爲iOS應用程序跟蹤實施了新的Google Analytics庫(2.0)。跟蹤視圖等非常簡單,但我無法理解如何使用維度和指標。谷歌分析 - 任何人都可以解釋維度和指標?

我已經多次閱讀文檔,但是我無法繞過它。

基本上,我想檢查有多少用戶在使用應用程序時啓用了特定的設置。

在semipseudo代碼,這是我想要做什麼:

- (void)applicationLaunched 
{ 
    id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:@"My ID"]; 

    if (_mySettingIsEnabled) { 
     [tracker setUserValue:@"Enabled" forKey:@"My Setting"]; 
    } else { 
     [tracker setUserValue:@"Disabled" forKey:@"My Setting"]; 
    } 
} 

任何人都可以向我解釋,我將如何使用維度和指標做到這一點每個用戶?

回答

1

基本上,你可能會去custom variables

啓用特定設置可能是用戶或會話級別,因此您應將範圍設置爲1或2.您要跟蹤的設置是您的自定義var或「維度」的值,並且根據範圍的不同,您可以自動獲得用戶的指標數量或訪問次數。

在JS,看起來像

_gaq.push(['_setCustomVar', 
     1,    // This custom var is set to slot #1. Required parameter. 
     'My Setting', // The name of the custom variable. Required parameter. 
     'Disabled',  // The value of the custom variable. Required parameter. 
         // (possible values might be Free, Bronze, Gold, and Platinum) 
     1     // Sets the scope to visitor-level. Optional parameter. 
]); 
+1

這是網絡跟蹤真實的,但自定義變量並不在iOS的庫中存在,所以基本上我問如何將相同的原則應用於自定義指標和維度 – Accatyyc 2013-05-20 15:22:12

+0

不熟悉那個,但我發現這個資源:https://developers.google.com/analytics/devguides/collection/ios/devguide#usingCustomVariables – 2013-05-20 15:36:39

2

檢查的官方文檔:https://developers.google.com/analytics/devguides/collection/ios/v2/customdimsmets

  • 確保你有一個新的屬性(GA在帳戶/屬性/配置文件進行組織,因此點擊「家」,而不是一個帳戶,而不是添加一個新的應用程序屬性) - 我有一個較舊的屬性/配置文件,沒有任何工作與IOS GA庫2.0。

  • 註冊的GA網絡上,打開屬性,將有自定義,在那裏你可以註冊自定義維度和指標選項卡 - 比方說,「APPMODE」,這是與索引1

  • 自定義的定義
  • 在代碼中設置自定義維度/指標值:

    NSString *appMode = @"Demo"; 
    [_gaiTracker setCustom:1 dimension:appMode]; 
    
+0

這裏是新版本 https://developers.google。 com/analytics/devguides/collection/ios/v3/customdimsmets – 2014-02-11 08:26:57

+0

和Javascript https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets – 2014-02-11 08:27:20

相關問題