2

在我的iPhone應用程序中,我正在使用Omniture進行跟蹤。如何跟蹤iPhone應用程序中的全部內容

我在AppDelegate中編寫代碼:

OMAppMeasurement * s = [OMAppMeasurement getInstance]; 

/* Specify the Report Suite ID(s) to track here */ 
s.account = @"reportSuiteID"; 

s.currencyCode = @"USD"; 
/* Turn on and configure debugging here */ 

s.debugTracking = YES; 

/* WARNING: Changing any of the below variables will cause drastic 
changes 
to how your visitor data is collected. Changes should only be made 
when instructed to do so by your account manager.*/ 

[email protected]"firstViewController"; 

s.trackingServer = @"trackingserver"; 
[s track]; 

我的控制檯顯示只有一行:

應用測試庫的編譯時間= 2011年1月25日11時46分14秒

建議我我做錯了什麼?

我的代碼是否在正確的位置?

而我在哪裏可以看到報告?

回答

1

與我們的所有客戶端,我們一直使用實施不同的sintax。 把 OMAppMeasurement * s; AppDelegate中的 以及applicationDidFinishLaunching函數中的所有配置代碼。 這是所有Omniture實施文檔中的認證實施。

#import "BasicExampleAppDelegate.h" 
@implementation BasicExampleAppDelegate 

OMAppMeasurement * s; 

@synthesize window = window_; 

- (void)applicationDidFinishLaunching:(UIApplication *)application { 

    //Instantiate instance 
    s = [[OMAppMeasurement alloc] init]; 
    //Setup application config variables 
    s.account = @"RSID"; 

    s.trackingServer = @"TRACKSERVER"; 

    s.pageName = @"Main Page"; 

    [s track]; 

    [window_ makeKeyAndVisible]; 
} 

- (void)dealloc { 
    [s release]; 
    [window_ release]; 
    [super dealloc]; 
} 

@end 
+0

@Claudio Sermenghi:非常感謝,我想了解更多信息,如果我想跟蹤其他頁面,該怎麼辦?這段代碼是否只追蹤「主頁」? – Meghan 2011-03-03 11:32:42

+0

這是實例化跟蹤對象並將第一個pageView發送到Omniture服務器的配置代碼。爲了跟蹤所有其他操作,您必須在每個要跟蹤的動作(例如按鈕推送,頁面重新加載,應用程序導航)中將呼叫轉到s.pageName = @「New Page Name」和[s track] – 2011-03-04 08:45:36

+0

@Claudio Sermenghi:謝謝。我知道了。我還有一個疑問就是,正如你所說的那樣,打電話給s。pagename = @「New Page Name」和[s track],是否應該在每個我想跟蹤的頁面上創建對象(OMAppMeasurement * s = [[OMAppMeasurement alloc] init];) – Meghan 2011-03-05 03:59:34

0

檢查項目中是否包含所有必需的文件和框架(「OMAppMeasurement.h」和框架libOmnitureAppMeasurement-iPhoneDevice.a和libOmnitureAppMeasurement-iPhoneSimulator_4_0_GM.a)。

嘗試使用您自己的跟蹤數據創建NSDictionary並使用(void)track:(NSDictionary *)variableOverrides。如果跟蹤成功,則沒有正面信號(作爲日誌聲明)。

報告可以在Omniture網站上查看。

編輯: 初始化代碼必須是在UIAppDelegate。 [跟蹤]調用必須是您想要跟蹤某些數據的位置(例如,在某些UIViewController的init方法中或按某個按鈕之後)。

指南可以發現here

+0

感謝您的輸入負載。你可以給我一個簡短的教程或參考一些文章,我可以更好地理解Omniture嗎?代碼也放在正確的地方嗎?它目前在我的AppDelegate下。 – Meghan 2011-02-25 12:38:45

+0

再次感謝。所以在有問題的代碼中,我必須刪除[s track]和s.pagename?在其他頁面中,我應該使用AppDelegate本身的對象還是爲不同的頁面創建不同的對象? – Meghan 2011-02-26 07:26:31

+0

如果我想跟蹤來自不同視圖的數據(如s.pageName,s.currencyCode等),我的代碼應該在AppDelegate和其他視圖中? (比如firstViewController,secondViewController)。 – Meghan 2011-02-26 07:31:55