Google Analytics Integrations by Daniel Waisberg
Author:Daniel Waisberg
Language: eng
Format: mobi, epub
Published: 2015-04-25T03:56:54+00:00
Mobile Apps Integrations 79
Step 3: Add Campaign Parameters to Your Links to iTunes
This step is very similar to Google Play’s instructions for Android as described in Step 3 in the previous section. The only diff erence is that iOS links will require additional parameters: Google Analytics Property ID, Ad Network, and Redirect URL. You can fi nd the iOS Campaign Tracking URL Builder (see Figure 4-6) at http://goo.gl/Arg8tw.
Figure 4-6: iOS Campaign Tracking URL Builder
Step 4: Customize the iOS SDK to General Campaign Tracking
and Traffi c Source Attribution
Similarly to the process described for Google Play (Step 4 from the previous section), in order to capture traffi
c sources for users who land directly in your app (after installing it, in subsequent sessions), c04.indd 03/25/15 Page 79
80 Chapter 4 Mobile Apps Integrations
you will still need to tag your links as described in Step 3 so that Google Analytics understands where the user comes from. In addition to that, you also need to use [GAIDictionaryBuilder
setCampaignParametersFromUrl:urlString], where urlString is a string representing an URL that
may contain Google Analytics campaign parameters. Here is an example of how to do it (for the
source, go to http://goo.gl/KHVs17):
/*
* MyAppDelegate.m
*
* An example of how to implement campaign and referral attribution. If no
* Google Analytics campaign parameters are set in the referring URL, use the
* hostname as a referrer instead.
*/
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *) url {
NSString *urlString = [url absoluteString];
id<GAITracker> tracker = [[GAI sharedInstance]
trackerWithName:@"tracker" trackingId:@"UA-XXXX-Y"];
// setCampaignParametersFromUrl: parses Google Analytics campaign
// ("UTM")parameters from a string url into a Map that can be set on a Tracker.
GAIDictionaryBuilder *hitParams = [[GAIDictionaryBuilder alloc] init];
// Set campaign data on the map, not the tracker directly because it only needs
// to be sent once.
[[hitParams setCampaignParametersFromUrl:urlString] build];
// Campaign source is the only required campaign field. If previous call did
// not set a campaign source, use the hostname as a referrer instead.
if(![hitParams valueForKey:kGAICampaignSource] && [url host].length !=0) {
// Set campaign data on the map, not the tracker.
[hitParams set:kGAICampaignMedium value:@"referrer"];
[hitParams set:kGAICampaignSource value:[url host]];
}
[tracker send:[[[GAIDictionaryBuilder createAppView] setAll:hitParams] build]];
c04.indd 03/25/15 Page 80
Mobile Apps Integrations 81
APP TRAFFIC SOURCE ATTRIBUTION
When you fi nish the integration (either Android or iOS), you will be able to see the sources of your acquisition campaigns and subsequent app sessions. Awesome. However, there remains
one important question: how does Google Analytics attribute a source to a session? There are
four possible ways for a user to reach an app, but only two outcomes when it comes to the way
the source attribution behaves.
■ The user opens the app without clicking on an external link: the current session will be
attributed to the original source.
■ The user clicks on an external link that does not include the campaign parameters (explained in Step 3 in the previous section): the current session will be attributed to the original source.
■ The user clicks on an external link that includes the campaign parameters but the SDK was
not modifi ed to capture those links (as explained in Step 4 in the previous section): the
current session will be attributed to the original source.
■ The user clicks on an external link
Download
Google Analytics Integrations by Daniel Waisberg.epub
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Bad Blood by John Carreyrou(6270)
Rich Dad Poor Dad by Robert T. Kiyosaki(6169)
Principles: Life and Work by Ray Dalio(5951)
Playing to Win_ How Strategy Really Works by A.G. Lafley & Roger L. Martin(5467)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4437)
The Confidence Code by Katty Kay(4033)
Thinking in Bets by Annie Duke(3995)
American Kingpin by Nick Bilton(3499)
Delivering Happiness by Tony Hsieh(3280)
Project Animal Farm: An Accidental Journey into the Secret World of Farming and the Truth About Our Food by Sonia Faruqi(3008)
The Power of Habit by Charles Duhigg(2960)
Brotopia by Emily Chang(2888)
Mastering Bitcoin: Programming the Open Blockchain by Andreas M. Antonopoulos(2887)
The Tyranny of Metrics by Jerry Z. Muller(2843)
I Live in the Future & Here's How It Works by Nick Bilton(2839)
The Marketing Plan Handbook: Develop Big-Picture Marketing Plans for Pennies on the Dollar by Robert W. Bly(2790)
The Content Trap by Bharat Anand(2774)
Building a StoryBrand by Donald Miller(2751)
Applied Empathy by Michael Ventura(2742)
