Let's imagine, that you are a developer of Android or Apple iOS applications and you would like to know the top referring source of purchases of your application or of in-apps of your application.
Maybe you would say that Google Play and Apple Store allows you to do so, but unfortunately that is not the case. This article is going to shed some light on tracking purchases/downloads of mobile applications (or in-apps) on Android and Apple iOS for iPhones and iPads. It will show you also an example how to keep track of conversions brought by Google Adwords. Let's begin: The initial setup of Post Affiliate Pro campaign and banner differs when using a hosted solution of Post Affiliate Pro or owned solution of Post Affiliate Pro.
Case: Hosted Post Affiliate Pro
In Post Affiliate Pro (PAP) you need to create a campaign and choose "Standard link (redirect)" linking method in this campaign. It is essential. Then you need to create a banner (link banner) that will be assigned to the particular campaign.
The destination URL of the banner has to be the URL leading to the site of your application in Google Play or Apple Store
Sub-case: using GoogleAdwords: https://support.qualityunit.com/196374-Anchor-links
Afterwards, let's have some dummy affiliate, e.g. 'GA Affiliate' whose referral id will be 'gaaffiliate'. Let's log in to the account of that particular affiliate and find the link of the banner we created. This banner will show an URL leading to: PAP_URL/scripts/click.php?a_aid=gaaffiliate&a_bid=someBannerId Now you need to place that URL into Google AdWords.
This way, you ensure, that whoever clicks the particular Google AdWords add he/she will be redirected to the page of your application in Google Play or Apple Store while there will be a click tracked by PAP.
Case: Owned solution of Post Affiliate Pro
In an owned (self-hosted) Post Affiliate Pro (PAP) you would leave the campaign to use 'new style link' or 'anchor links' linking method. The Destination URL of the link banner would point a custom site of yours where you would have the following script:
The script above handles the redirection to the proper store based on the operating system of the mobile device the customer uses.
Now let's track the particular action (download/purchase). In case a user downloads and installs your application an invisible WebView (a component to display a web page) will be executed and by that there will be a URL open that leads to the sale tracking script (can be downloaded from PAP). An example of such a code is below:
In that code there are 2 very important functions: setData() and registerSale() The setData() function is called from the mobile application (both Android and iOS allow to call and execute through the mentioned WebView component JS functions) and sets different action parameters: - is it a download or purchase? - what product? - what OS? - etc.
There are many options concerning action parameters, since the PAP sale tracking code provides up to 5 extra data to be tracked – so you can use the setData() function multiple times. After having all of those action parameters set it is time to call the registerSale() function that will forward all of the tracked actions to PAP, while the tracked transaction will be assigned to the proper affiliate.
Example WebView script for Android: