Requirements

Prerequisite knowledge
Experience developing viewers with Digital Publishing Suite is required. Experience in development of viewer apps with a custom storefront is preferable.
 
User level: Intermediate, Advanced
Required products
 
Additional required other products
 
 
This article describes how to use eMagazines Insight to measure app installs and in-app purchases by Campaign ID. By installing the eMagazines Insight Javascript-SDK and using the eMagazines Campaign Tracking Links, you can evaluate marketing return on investment, compensate affiliate partners for their sales performance, and easily sell through ad networks. Tracking can be done either from a folio by using an HTML overlay or from a custom store.

 
How it works

Whenever you promote your app, whether it's simply adding the App Store badge to your website, or an advertisement on Google Adwords, you can use eMagazines Insight to measure the resulting app downloads and lifetime value (in-app purchases) of the customers you gain.
eMagazines Insight connects the initial click from the Campaign Tracking Link you set up to the resulting install and first run of your app.
The system does not use device IDs or any user-private data. The way it works is by heuristically matching session context data when the eMagazines Insight Campaign Tracking Link is followed with context data when the app is actually run. If there is a close enough match, it is considered a hit and the link is credited with an app install. From then on, all in-app purchase and event records are associated with that campaign or affiliate. The matching is elastic, so by tweaking some weighting factors, publishers can match a user by following a campaign link on the user's desktop PC to an app install on his or her iPad.
Every effort has been made to make this as simple as possible. Publishers insert a few lines of script and get back a wealth of data they can use to optimize their promotional campaigns and affiliate programs.

 
Installing the Javascript-SDK

eMagazines Insight provides a Javascript-SDK (EMA-JS) for Adobe DPS webviews. The SDK can be used from either a web overlay from within a folio or from a custom store.
To use the SDK you will first need to register with eMagazines and get an eMagazines app-id. Next, insert the JavaScript below into your HTML source. Be sure to replace {insert-app-id} with your app-id.
 
<script src="https://api.emagazines.com/ema/jquery-1.9.0.min.js" type="text/javascript" ></script> <script src="https://api.emagazines.com/ema/ema-1.0.js" type="text/javascript" appId="{insert-app-id}"></script>
Behind the scenes, the SDK links the actual running instance of an app to a publisher's Campaign ID. From the eMagazines Insight dashboard, you can create promotional campaigns and build Campaign Tracking Links that can be used in websites, emails, and anywhere you promote your app. Users who follow these links can directly download your app and install it. Once your app is up and running, all subsequent in-app transactions will be credited to the original Campaign ID.
 
The following snippet is used to track an in-app purchase event:
<script src="https://api.emagazines.com/ema/jquery-1.9.0.min.js" type="text/javascript" ></script> <script src="https://api.emagazines.com/ema/ema-1.0.js" type="text/javascript" appId="ABC-1234" onInit="emaStarted"></script> <script language="Javascript"> function emaStarted() { EMEvent("start"); } var transaction = folio.purchase(); transaction.completedSignal.addOnce(function(transaction) { if (transaction.state == adobeDPS.transactionManager.transactionStates.FINISHED) { EMPurchase("February 2013 Issue", "SKU-123456", 4.99, "USD", 1, "home, furnishing"); } else if (transaction.state == adobeDPS.transactionManager.transactionStates.FAILED) { alert("Sorry, unable to purchase"); } }, this); </script>
On the <script> tag for ema-1.0.js script, you can provide a JavaScript callback function that is called when the EMA-JS script has finished loading. Inside that function, you can use a range of EM#### calls to adjust the settings, register user interaction events, and provide user contact information (if provided by the user), location-based data (if explicitly authorized by the user), or purchasing interactions.
In the above example, when the user completes a purchase, a call to EMPurchase is made to register the transaction with EMA-JS.
EMA-JS caches all event data locally on the device. Periodically, the data is bulk-uploaded to the eMagazines servers and the cached data is wiped clean. The frequency of this update is up to the publisher (the default is every 60 seconds). The system is designed to be tolerant of network failures or interruptions during transmission.
 
Once the data is sent to the server, publishers can login to the eMagazines Insight dashboard to perform analytics and obtain aggregated reports on the success of their campaigns (see Figure 1). Publishers can determine how to credit affiliates and get access to the raw data to perform their own analyses.
Figure 1. The eMagazines Insight dashboard provides quick summary graphs and more detailed reports.
Figure 1. The eMagazines Insight dashboard provides quick summary graphs and more detailed reports.

 
Tracking commerce events

EMA-JS allows publishers to connect in-app purchases of single issues, subscriptions (monthly or annual) to a Campaign ID. The data can be used to track the success of promotions, compensate affiliates, or to improve the efficiency of ads.
The EMPurchase function (above) provides a direct way to track in-app purchases. By inserting EMEvent calls any in-app event can be added to the EMA queue and tracked to the original marketing campaign or affiliate.
EMEvent allows generic application events, along with arbitrary data, to be easily sent to the EMA queue. This includes user interactions with interactive ad content. For example:
 
EMEvent("ad", { adId: "AD-34422", issue: "FL-44302" }); EMEvent("storevisit", { storepage: "2", issue: "GH-221" }); To track an in-app subscription purchase, you could use the following: <script src="https://api.emagazines.com/ema/jquery-1.9.0.min.js" type="text/javascript" ></script> <script src="https://api.emagazines.com/ema/ema-1.0.js" type="text/javascript" appId="ABC-1234" onInit="emaStarted"></script> <script language="Javascript"> var transaction = subscription.purchase(); transaction.completedSignal.addOnce(function(transaction) { if (transaction.state == adobeDPS.transactionManager.transactionStates.FINISHED) { EMPurchase("1 year subscription", "SKU-56789", 24.99, "USD", 1, "1yrsub", { activity: "subscription", duration: "1y" } ); } }, this); </script>
On the server, commerce events can be viewed and analyzed as shown in Figure 2:
 
Figure 2. Activity data are available to analyze through the eMagazines Insight dashboard.
Figure 2. Activity data are available to analyze through the eMagazines Insight dashboard.

 
Building campaign tracking links

Once the EMA-JS is installed in your DPS app, you can build Campaign Tracking Links from within the eMagazines Insight dashboard (see figures 3 and 4).
 
Figure 3. eMagazines Insight Campaign Tracking Link building view. Add multiple parameters to your links so you recognize the promotion when the installs and in-app purchases are reported.
Figure 3. eMagazines Insight Campaign Tracking Link building view. Add multiple parameters to your links so you recognize the promotion when the installs and in-app purchases are reported.
 
Figure 4. Copy and paste your unique Campaign Tracking Link.
Figure 4. Copy and paste your unique Campaign Tracking Link.
 
Sample URL:
http://www.emagazines.com/insight/link/?user=4016&g={5C52B929-BACA-4864-856A-16A783097F36
Note: Use a link shortener if you are posting on Twitter or other space-constrained location.
eMagazines Insight allows for the tracking of dynamic variables that can be appended to the Campaign Tracking Link. One variable provided by default is track1. This lets you pass any parameter through the URL and receive install and in-app purchase data that ties back to this unique parameter.
 

 
Selling with affiliates and ad networks

eMagazines Insight provides support for the development of private pay-for-performance affiliate networks. You define how much to compensate your affiliates for every download and/or in-app purchase they drive. Affiliates sign up on the eMagazines Network page and are connected to your account to promote your app.
With the eMagazines Javascript-SDK installed, you can advertise on mobile ad platforms or CPA networks without having to install any extra code, so you can test and start promotions fast. The eMagazines Campaign Tracking Links accept unique identifiers passed in by third-party networks, so app downloads and in-app sales attribution is documented in real time. eMagazines has integrated and tested its tracking code with top ad networks, so once the eMagazines Javascript-SDK is installed, you can start advertising and measuring performance.

 
Where to go from here

For more information, visit eMagazines at http://www.emagazines.com or contact eMagazines at adobeinfo@emagazines.com for specific questions.