{"action":"created","comment":{"url":"https://api.github.com/repos/piwik/piwik-sdk-android/pulls/comments/51202449","id":51202449,"diff_hunk":"@@ -4,4 +4,14 @@\n \n     <uses-permission android:name=\"android.permission.INTERNET\"/>\n     <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>\n+\n+    <application>\n+        <receiver\n+            android:name=\".InstallReferrerReceiver\"","path":"piwik-sdk/src/main/AndroidManifest.xml","position":7,"original_position":7,"commit_id":"55890944cf20b1b3ad761d7155fb101b2655c86a","original_commit_id":"55890944cf20b1b3ad761d7155fb101b2655c86a","user":{"login":"dotsbb","id":273492,"avatar_url":"https://avatars.githubusercontent.com/u/273492?v=3","gravatar_id":"","url":"https://api.github.com/users/dotsbb","html_url":"https://github.com/dotsbb","followers_url":"https://api.github.com/users/dotsbb/followers","following_url":"https://api.github.com/users/dotsbb/following{/other_user}","gists_url":"https://api.github.com/users/dotsbb/gists{/gist_id}","starred_url":"https://api.github.com/users/dotsbb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotsbb/subscriptions","organizations_url":"https://api.github.com/users/dotsbb/orgs","repos_url":"https://api.github.com/users/dotsbb/repos","events_url":"https://api.github.com/users/dotsbb/events{/privacy}","received_events_url":"https://api.github.com/users/dotsbb/received_events","type":"User","site_admin":false},"body":"nvm, I thought that devs have to declare it explicitly in theirs apps `AndroidManifest.xml` ","created_at":"2016-01-28T23:02:12Z","updated_at":"2016-01-28T23:02:12Z","html_url":"https://github.com/piwik/piwik-sdk-android/pull/83#discussion_r51202449","pull_request_url":"https://api.github.com/repos/piwik/piwik-sdk-android/pulls/83","_links":{"self":{"href":"https://api.github.com/repos/piwik/piwik-sdk-android/pulls/comments/51202449"},"html":{"href":"https://github.com/piwik/piwik-sdk-android/pull/83#discussion_r51202449"},"pull_request":{"href":"https://api.github.com/repos/piwik/piwik-sdk-android/pulls/83"}}},"pull_request":{"url":"https://api.github.com/repos/piwik/piwik-sdk-android/pulls/83","id":57182518,"html_url":"https://github.com/piwik/piwik-sdk-android/pull/83","diff_url":"https://github.com/piwik/piwik-sdk-android/pull/83.diff","patch_url":"https://github.com/piwik/piwik-sdk-android/pull/83.patch","issue_url":"https://api.github.com/repos/piwik/piwik-sdk-android/issues/83","number":83,"state":"open","locked":false,"title":"Referrer improvements","user":{"login":"d4rken","id":1439229,"avatar_url":"https://avatars.githubusercontent.com/u/1439229?v=3","gravatar_id":"","url":"https://api.github.com/users/d4rken","html_url":"https://github.com/d4rken","followers_url":"https://api.github.com/users/d4rken/followers","following_url":"https://api.github.com/users/d4rken/following{/other_user}","gists_url":"https://api.github.com/users/d4rken/gists{/gist_id}","starred_url":"https://api.github.com/users/d4rken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d4rken/subscriptions","organizations_url":"https://api.github.com/users/d4rken/orgs","repos_url":"https://api.github.com/users/d4rken/repos","events_url":"https://api.github.com/users/d4rken/events{/privacy}","received_events_url":"https://api.github.com/users/d4rken/received_events","type":"User","site_admin":false},"body":"So this is a new idea in progress:\r\nI recently learned that the Google Play app sends an intent ```com.android.vending.INSTALL_REFERRER``` to the app it just installed, containing the parameters that were part of it's install url e.g. ```https://play.google.com/store/apps/details?id=com.piwik.demo&referrer=<REFERRERPARAMTERS>```.\r\n\r\nThat started the whole coding session and while add it changed a few other things.\r\n\r\n* ```Tracker.trackAppDownload()``` previously passed the installer packagename via QueryParams.REFERRER without modifcation, no one seems to have noticed but Piwik backend ignores non URLs.... so we now prepend ```http://```\r\n* The library now has a receiver that listens for above mentioned intent and if received, saves it into preferences.\r\n* Because the dev can call the track download method from within the ```Application.onCreate()``` , and the broadcast receiver causes it to initialize, the actual tracking is deferred by 3 seconds if Google Play is detected as download source.\r\n* I removed the ```Context``` parameter from the track download methods. Previously the idea was to use this as a way to track downloads of other apps. I've come to the conclusions though that this is not very clean because we can't guarantee certain functionality for other apps (access to the apk for checksum or receiving the install referrer). It's not something we should support, a dev could make his own method for this if wanted.\r\n* I removed the ```ExtraIdentifier.INSTALLER_PACKAGENAME``` flag. It was not a very good criteria to differentiate different downloads and this is already covered by Piwiks actual Referrer section. The default flag is now ```None```.\r\n* The download tracking is now in a sepperate class (I don't like huge classes).\r\n* I've added syncronization to the download tracking method that should only fire once per app version, while rare it was previously possible to cause multiple calls to execute.\r\n\r\nI've still got to add some unit tests and do some code polish.\r\n\r\nFor now i wanted some feedback and a question.\r\n\r\n@dotsbb What do you think about the idea of catching the Google Play intent and passing the data along with ```QueryParams.REFERRER``` field? I think the idea is cool, but i fear it's too specific and a dev should decide himself if this is something he wants to add. Maybe we should not fill the REFERRER parameter at all, by default, because we can't assume this is how most of the devs would want to use it... But then again that could be argued for tracking downloads too...\r\n\r\n@mattab Can you tell me what exactly the ```urlref``` parameter is used for when using the HTTP API? It seems the campaign section is only filled when passing the campaign names as queryparameter or part of the main ```url```. Is ```urlref``` parsed at all? There is an extra Campaign plugin in Piwik Market, but i wasn't able to install plugins on the demo server.\r\n\r\n![testreferrerparameters](https://cloud.githubusercontent.com/assets/1439229/12575794/af016714-c40f-11e5-9e90-eff0ea8fbd58.PNG)\r\n","created_at":"2016-01-26T08:41:12Z","updated_at":"2016-01-28T23:02:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"19fdc032bb0867a44fd4419a90d34b00c78e5346","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/piwik/piwik-sdk-android/pulls/83/commits","review_comments_url":"https://api.github.com/repos/piwik/piwik-sdk-android/pulls/83/comments","review_comment_url":"https://api.github.com/repos/piwik/piwik-sdk-android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/piwik/piwik-sdk-android/issues/83/comments","statuses_url":"https://api.github.com/repos/piwik/piwik-sdk-android/statuses/55890944cf20b1b3ad761d7155fb101b2655c86a","head":{"label":"d4rken:pr-gplayreferrer","ref":"pr-gplayreferrer","sha":"55890944cf20b1b3ad761d7155fb101b2655c86a","user":{"login":"d4rken","id":1439229,"avatar_url":"https://avatars.githubusercontent.com/u/1439229?v=3","gravatar_id":"","url":"https://api.github.com/users/d4rken","html_url":"https://github.com/d4rken","followers_url":"https://api.github.com/users/d4rken/followers","following_url":"https://api.github.com/users/d4rken/following{/other_user}","gists_url":"https://api.github.com/users/d4rken/gists{/gist_id}","starred_url":"https://api.github.com/users/d4rken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d4rken/subscriptions","organizations_url":"https://api.github.com/users/d4rken/orgs","repos_url":"https://api.github.com/users/d4rken/repos","events_url":"https://api.github.com/users/d4rken/events{/privacy}","received_events_url":"https://api.github.com/users/d4rken/received_events","type":"User","site_admin":false},"repo":{"id":32284263,"name":"piwik-sdk-android","full_name":"d4rken/piwik-sdk-android","owner":{"login":"d4rken","id":1439229,"avatar_url":"https://avatars.githubusercontent.com/u/1439229?v=3","gravatar_id":"","url":"https://api.github.com/users/d4rken","html_url":"https://github.com/d4rken","followers_url":"https://api.github.com/users/d4rken/followers","following_url":"https://api.github.com/users/d4rken/following{/other_user}","gists_url":"https://api.github.com/users/d4rken/gists{/gist_id}","starred_url":"https://api.github.com/users/d4rken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d4rken/subscriptions","organizations_url":"https://api.github.com/users/d4rken/orgs","repos_url":"https://api.github.com/users/d4rken/repos","events_url":"https://api.github.com/users/d4rken/events{/privacy}","received_events_url":"https://api.github.com/users/d4rken/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/d4rken/piwik-sdk-android","description":"SDK for Android to measure your apps with Piwik","fork":true,"url":"https://api.github.com/repos/d4rken/piwik-sdk-android","forks_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/forks","keys_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/teams","hooks_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/hooks","issue_events_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/issues/events{/number}","events_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/events","assignees_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/assignees{/user}","branches_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/branches{/branch}","tags_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/tags","blobs_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/statuses/{sha}","languages_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/languages","stargazers_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/stargazers","contributors_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/contributors","subscribers_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/subscribers","subscription_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/subscription","commits_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/contents/{+path}","compare_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/merges","archive_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/downloads","issues_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/issues{/number}","pulls_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/pulls{/number}","milestones_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/milestones{/number}","notifications_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/labels{/name}","releases_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/releases{/id}","deployments_url":"https://api.github.com/repos/d4rken/piwik-sdk-android/deployments","created_at":"2015-03-15T21:10:31Z","updated_at":"2016-01-14T06:19:15Z","pushed_at":"2016-01-26T08:10:38Z","git_url":"git://github.com/d4rken/piwik-sdk-android.git","ssh_url":"git@github.com:d4rken/piwik-sdk-android.git","clone_url":"https://github.com/d4rken/piwik-sdk-android.git","svn_url":"https://github.com/d4rken/piwik-sdk-android","homepage":null,"size":5115,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"piwik:dev","ref":"dev","sha":"903ad81b47bdb34465da04e60f3dc3062feeb3ba","user":{"login":"piwik","id":698038,"avatar_url":"https://avatars.githubusercontent.com/u/698038?v=3","gravatar_id":"","url":"https://api.github.com/users/piwik","html_url":"https://github.com/piwik","followers_url":"https://api.github.com/users/piwik/followers","following_url":"https://api.github.com/users/piwik/following{/other_user}","gists_url":"https://api.github.com/users/piwik/gists{/gist_id}","starred_url":"https://api.github.com/users/piwik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piwik/subscriptions","organizations_url":"https://api.github.com/users/piwik/orgs","repos_url":"https://api.github.com/users/piwik/repos","events_url":"https://api.github.com/users/piwik/events{/privacy}","received_events_url":"https://api.github.com/users/piwik/received_events","type":"Organization","site_admin":false},"repo":{"id":23343072,"name":"piwik-sdk-android","full_name":"piwik/piwik-sdk-android","owner":{"login":"piwik","id":698038,"avatar_url":"https://avatars.githubusercontent.com/u/698038?v=3","gravatar_id":"","url":"https://api.github.com/users/piwik","html_url":"https://github.com/piwik","followers_url":"https://api.github.com/users/piwik/followers","following_url":"https://api.github.com/users/piwik/following{/other_user}","gists_url":"https://api.github.com/users/piwik/gists{/gist_id}","starred_url":"https://api.github.com/users/piwik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piwik/subscriptions","organizations_url":"https://api.github.com/users/piwik/orgs","repos_url":"https://api.github.com/users/piwik/repos","events_url":"https://api.github.com/users/piwik/events{/privacy}","received_events_url":"https://api.github.com/users/piwik/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/piwik/piwik-sdk-android","description":"SDK for Android to measure your apps with Piwik","fork":false,"url":"https://api.github.com/repos/piwik/piwik-sdk-android","forks_url":"https://api.github.com/repos/piwik/piwik-sdk-android/forks","keys_url":"https://api.github.com/repos/piwik/piwik-sdk-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/piwik/piwik-sdk-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/piwik/piwik-sdk-android/teams","hooks_url":"https://api.github.com/repos/piwik/piwik-sdk-android/hooks","issue_events_url":"https://api.github.com/repos/piwik/piwik-sdk-android/issues/events{/number}","events_url":"https://api.github.com/repos/piwik/piwik-sdk-android/events","assignees_url":"https://api.github.com/repos/piwik/piwik-sdk-android/assignees{/user}","branches_url":"https://api.github.com/repos/piwik/piwik-sdk-android/branches{/branch}","tags_url":"https://api.github.com/repos/piwik/piwik-sdk-android/tags","blobs_url":"https://api.github.com/repos/piwik/piwik-sdk-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/piwik/piwik-sdk-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/piwik/piwik-sdk-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/piwik/piwik-sdk-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/piwik/piwik-sdk-android/statuses/{sha}","languages_url":"https://api.github.com/repos/piwik/piwik-sdk-android/languages","stargazers_url":"https://api.github.com/repos/piwik/piwik-sdk-android/stargazers","contributors_url":"https://api.github.com/repos/piwik/piwik-sdk-android/contributors","subscribers_url":"https://api.github.com/repos/piwik/piwik-sdk-android/subscribers","subscription_url":"https://api.github.com/repos/piwik/piwik-sdk-android/subscription","commits_url":"https://api.github.com/repos/piwik/piwik-sdk-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/piwik/piwik-sdk-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/piwik/piwik-sdk-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/piwik/piwik-sdk-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/piwik/piwik-sdk-android/contents/{+path}","compare_url":"https://api.github.com/repos/piwik/piwik-sdk-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/piwik/piwik-sdk-android/merges","archive_url":"https://api.github.com/repos/piwik/piwik-sdk-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/piwik/piwik-sdk-android/downloads","issues_url":"https://api.github.com/repos/piwik/piwik-sdk-android/issues{/number}","pulls_url":"https://api.github.com/repos/piwik/piwik-sdk-android/pulls{/number}","milestones_url":"https://api.github.com/repos/piwik/piwik-sdk-android/milestones{/number}","notifications_url":"https://api.github.com/repos/piwik/piwik-sdk-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/piwik/piwik-sdk-android/labels{/name}","releases_url":"https://api.github.com/repos/piwik/piwik-sdk-android/releases{/id}","deployments_url":"https://api.github.com/repos/piwik/piwik-sdk-android/deployments","created_at":"2014-08-26T07:37:33Z","updated_at":"2016-01-28T13:43:01Z","pushed_at":"2016-01-26T08:41:12Z","git_url":"git://github.com/piwik/piwik-sdk-android.git","ssh_url":"git@github.com:piwik/piwik-sdk-android.git","clone_url":"https://github.com/piwik/piwik-sdk-android.git","svn_url":"https://github.com/piwik/piwik-sdk-android","homepage":null,"size":5109,"stargazers_count":68,"watchers_count":68,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":31,"mirror_url":null,"open_issues_count":5,"forks":31,"open_issues":5,"watchers":68,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/piwik/piwik-sdk-android/pulls/83"},"html":{"href":"https://github.com/piwik/piwik-sdk-android/pull/83"},"issue":{"href":"https://api.github.com/repos/piwik/piwik-sdk-android/issues/83"},"comments":{"href":"https://api.github.com/repos/piwik/piwik-sdk-android/issues/83/comments"},"review_comments":{"href":"https://api.github.com/repos/piwik/piwik-sdk-android/pulls/83/comments"},"review_comment":{"href":"https://api.github.com/repos/piwik/piwik-sdk-android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/piwik/piwik-sdk-android/pulls/83/commits"},"statuses":{"href":"https://api.github.com/repos/piwik/piwik-sdk-android/statuses/55890944cf20b1b3ad761d7155fb101b2655c86a"}}}}