27

We want to be able to track, using Google Analytics, any click throughs from the iPhone Smart Banner that we have added to our website.

The meta code used to add the smart banner is:

<meta name="apple-itunes-app" content="app-id=myAppStoreID">

So far I've tried dumping the page DOM using javascript to see if there is any associated HTML, but it seems the smart banner is outside of the DOM and possibly at the safari or browser app level?

Ideally we would like to use the standard browser based javascript google analytics tracking code, as modifying our app itself to accept parameters being parsed through is not currently an option.

Does anyone know how we could track click throughs from the smart banner to open or install the app?

danielsan
  • 426
  • 1
  • 4
  • 7
  • @ceejayoz yeah I didn't think so, yet holding out some optimism that someone may have cracked it, or will crack it soon :) – danielsan Oct 16 '12 at 02:19
  • You can do it from application level if this is a webview instance of an iPhone application. – egiray Feb 06 '13 at 11:39
  • @egiray unfortunately not. Thanks for your feedback, although we're still hoping that a way will become available, at this point in time it's not worth our effort to modify the application itself to gather such information. – danielsan Feb 15 '13 at 01:04

4 Answers4

34

Here's an update to this. To answer the original question: Yes you can track clicks on smartapp banners on the website. Here's how.

Firstly Linkshare affiliate is history. Sign up for PHG affiliate here

Once you sign up you'll get a affiliate id. Enter your affiliate ID in the Smartapp Meta Tag as shown below

<meta name="apple-itunes-app" content="app-id=311507490, affiliate-data=at=11m7as&ct=website_smartapp"/>

Where at=(Your affiliate ID) and ct=[campaign type(enter any text here for your reference)]

at and ct values with number of clicks will be shown on your PHG dashboard

Hope this helps

Sandeep
  • 481
  • 4
  • 5
  • Thank you @Sandeep. This is exactly what I was looking for. Deserves more upvotes – Sean Apr 11 '14 at 21:32
  • The problem I see is that, you can track the number of users that click at the smart banner. And you can get the number of installs. But the number of installs is not only the installs of your app. This number also has the installs that a user has done after the 24 hours of the clicks at the app store. So you can get an estimation, but not exact date. – Néstor Sep 12 '14 at 06:43
  • 3
    Does anyone else cringe putting unencoded, unescaped, unquoted = signs in the affiliate-data? It looks like it shouldn't work. – Chris Seline Dec 10 '14 at 01:21
  • @Chirs Seline can you confirm that unencoded wouldn't work, did encoded work? – РАВИ Dec 02 '15 at 18:07
9

It's not possible to track clicks on your Smart Banner, but it is possible to track the number of installs that come from your Smart Banner. There are three two ways you can do it:

1) Use Tapstream to track your installs from your web page to the app. It even integrates with Google Analytics.

2) If you have a paid app, you can use the affiliate-data parameter. You'll need to sign up as an iTunes Affiliate (but you should do that anyway if you care about iOS analytics; it's the only official way to measure conversion rates on iOS).

Here's the instructions for Linkshare, the US affiliate partner. Log in to Linkshare, click Links -> Deep Linking in the menu. Select "US iTunes, App Store, iBookstore, and Mac App Store" as your advertiser and paste in an itunes URL. You'll get a link like this:

http://click.linksynergy.com/fs-bin/click?id=XXXXXXXXXXX&subid=&offerid=[...]

That "id=XXXXXXXXXX" section is your site ID. Linkshare's partner ID is 30. So put this in your smart banner:

<meta name="apple-itunes-app" content="app-id=311507490,
  affiliate-data=partnerId=30&siteID=XXXXXXXXX"/>

Where XXXXXXXXXX is your site ID. Linkshare can then tell you how many installs you received.

3) Use the app-argument parameter to pass data from your web page to your app, and record the number of installs yourself. (You'll have to keep/manage the logs yourself on your own server, but at least you'll have the data.) EDIT: As pointed out in a comment, app-argument only applies if you click Open when the app is already installed; it does not help to track installs.

Dan Fabulich
  • 37,506
  • 41
  • 139
  • 175
  • FYI, I have yet to find any way to pass LinkShare "signature" parameters to the Smart Banner. http://stackoverflow.com/questions/14851169/is-it-possible-to-use-linkshare-signatures-in-an-ios-smart-banner – Dan Fabulich Feb 13 '13 at 10:18
  • A belated thanks for your reply Dan, definitely something to look towards for future apps. – danielsan Jun 10 '13 at 01:40
  • 1
    "Use the app-argument parameter to pass data from your web page to your app, and record the number of installs yourself." This only happens if you click Open when the app is already installed; it does not help to *track installs*. – user102008 Aug 15 '13 at 00:47
2

No, unfortunately.

If you link the iOS simulator (you can also link your actual device) to the safari webkit inspector you'll notice that the full HTML body exists outside of the banner displayed, meaning that you have no scope to reach into to attach tracking events to.

Web Inspector Screenshot

Note that in this screenshot the mouse is hovering over the element, thus you see it highlighted in the simulator to the left.

FYI, for details on how to connect your desktop inspector to a mobile environment, see here (spoiler, it's AWESOMELY useful): http://webdesign.tutsplus.com/tutorials/workflow-tutorials/quick-tip-using-web-inspector-to-debug-mobile-safari/

whoughton
  • 1,395
  • 11
  • 21
2

I think you will need to track this from the app rather than from the website. If you have implemented the application:openURL:sourceApplication:annotation: method in your app delegate then you should be able to send an event to google analytics from within that method.

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
    [tracker sendEventWithCategory:@"uiAction"
                        withAction:@"openFromSmartBanner"
                         withLabel:[NSString stringWithFormat@"%@",[url absoluteString]
                         withValue:nil];
    return YES;
}

This will trigger every time your app is opened from a smart banner and tell you what url it came from (if available from multiple websites). This will only give you clicks when the smart banner shows open button not when it shows view

Gallonallen
  • 576
  • 5
  • 14
  • When view is clicked installs are tracked by apple, so you can combine that to get closer. The problem is you will miss all clicks from people who viewed but did not install. – Gallonallen May 31 '13 at 14:48
  • Yeah, thanks for the reply - definitely appears to have to be the only way to get some form of data, though not all data unfortunately. – danielsan Jun 10 '13 at 01:39