Question

In my iPhone app I am using Omniture to track.

The code I am writing in 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.*/

s.pageName=@"firstViewController";

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

And my console shows only one line :

App Measurement Library compile time = Jan 25 2011 11:46:14

Suggest me what I am doing wrong?

Is my code at right place?

And in site where can I see reports?

Was it helpful?

Solution

With all our client we have used a different sintax for the implementation. We put OMAppMeasurement * s; in the AppDelegate and all the configuration code in applicationDidFinishLaunching function. This is the certified implementation found in all the Omniture Implementation Document.

#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

OTHER TIPS

Check if all necessary files and frameworks are included in your project ("OMAppMeasurement.h" and the frameworks libOmnitureAppMeasurement-iPhoneDevice.a and libOmnitureAppMeasurement-iPhoneSimulator_4_0_GM.a).

Try to create a NSDictionary with your own tracking data and use (void)track:(NSDictionary *)variableOverrides. There are no positive sign (as an log statement) if the tracking was successful.

The reports can be seen on the Omniture Website.

Edit: The initialization code had to be in the UIAppDelegate. The [track] call had to be where you want to track some data (e.g. in the init methods of some UIViewController or after some button was pressed).

A Guide can be found here

Take a look at this guide: http://www.2shared.com/document/dfkGsrwu/App_Measurement_for_iPhone_Imp.htm

helped me a lot, loads of information :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top