Note that I am not asking how to set up Adwords, I'm interested in how its attribution works.
Consider this workflow: An ad for a mobile app is shown on your mobile phone via Google search. Clicking on the ad takes you to the Apple AppStore. You purchase the app and run it. AdWords records a conversion that you can use to track your campaigns.
In order for this to work, Google requires you to add a little chunk of code to your app that calls home with some info. What I can't quite grok is how they are able to relate the ad click to the AppStore purchase. There has to be some sort of data passed around. How does this work? On the web, you'd do it with a cookie or some sort of query parameter.
Another workflow: You send a newsletter to people. They click a link in the newsletter that takes them to the Play Store ( or AppStore ). The user buys the app. How would you attribute the purchase to the newsletter?
Does anyone have any knowledge into how this works behind the scenes across multiple platforms and companies?