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 sma
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
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.
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.
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/
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