Correctly record WebAPK install source for Launch.HomescreenSource |
|||||
Issue descriptionCurrently, WebAPKs drop the ShortcutInfo::Source that's set by the installability code once installed. This means that we can't distinguish between WebAPKs added via the banner versus WebAPKs added via the add to homescreen menu item in the Launch.HomescreenSource metric. Having this distinction is important as this metric tells us how often users actually use the shortcuts (in contrast to metrics like InstallSource, which tell us how often the shortcuts are added). Given that banners are automatically offered to users, having a metric recording the proportion of launches from banner-sourced WebAPKs is an important data point for assessing their usefulness. One possible way of solving this is to store the source int in the Android Manifest that's generated for the WebAPK. This could then be read out and set in MainActivity.java so that WebappLauncherActivity correctly receives the right source. The downside is that the Manifest will differ for a WebAPK that's added via the menu item versus added from a banner (and also potentially differ for different browsers). pkotwicz@, do you have comments on any other potential downsides or solutions here?
,
Apr 13 2017
Agreed with Peter, storing how the WebAPK got created into WebappDataStorage or other place in Chrome's SharedPreference would be better than in the WebAPK's meta data. We only store these critical data without which will give a bad first time user experience if Chrome's data is cleaned. The "source" property doesn't cause bad user experience like missing "host browser", "background color" etc., so I don't suggest to store it in the APK. We are very careful when adding new meta data in AndroidManifest, since the two versions of Source will double the total number of WebAPKs that we need to cache in the WebAPK server, and in the Play store in the future.
,
Apr 13 2017
I agree with Peter & Xi - this should not be part of the manifest. We should cache it and best effort populate the source field. We could introduce a new entry which is WebAPK & Unknown installation source and only use it in the case of user clearing data which should be quite rare. wdyt?
,
Apr 25 2017
,
Apr 26 2017
Dominick, thoughts? We're pretty confident that we should do best effort in shared pref as opposed to baking it into the webapk
,
Apr 27 2017
Sorry for the delay in response. I'm totally happy with adding this to WebappDataStorage (we may need to eagerly create it), and fall back to an explicitly WebAPK-only "Unknown" source if the storage is cleared. That should ensure: - we have a best case source - if it gets wiped, we don't lose WebAPKs in the mass of "Unknown" which includes legacy shortcuts from long ago
,
May 2 2017
,
May 2 2017
SGTM. @Dom: after your CL (https://codereview.chromium.org/2808263004/) is done, I can start working on this bug:)
,
May 3 2017
Sorry for the delay on that one, I was waiting for some more feedback (and didn't see that it had come in). I'll sort it out ASAP.
,
May 3 2017
Issue 710970 has been merged into this issue.
,
May 3 2017
Good luck!
,
May 18 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/257ccdb4fa9b6a50d24f0f736402874dab49a5d2 commit 257ccdb4fa9b6a50d24f0f736402874dab49a5d2 Author: pkotwicz <pkotwicz@chromium.org> Date: Thu May 18 03:27:13 2017 Constrain ShortcutSource to valid values When Chrome requests a WebAPK install, the WebAPK server uses the newest available "WebAPK template". This means that if an old Chrome version installs a WebAPK, it may have installed a WebAPK which sends ShortcutSource values that the Chrome version does not support This CL constrains the value of the ShortcutSource in the WebappLauncherActivity launch intent to a valid value. For instance, m58 Chrome does not know about ShortcutSource#EXTERNAL_INTENT but the user might install a WebAPK which sends source==ShortcutSource#EXTERNAL_INTENT to Chrome BUG= 711147 Review-Url: https://codereview.chromium.org/2880413002 Cr-Commit-Position: refs/heads/master@{#472632} [modify] https://crrev.com/257ccdb4fa9b6a50d24f0f736402874dab49a5d2/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappInfo.java [modify] https://crrev.com/257ccdb4fa9b6a50d24f0f736402874dab49a5d2/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkInfoTest.java
,
May 24 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/80906b06689bd05c3b727c115242bedd7d6910f2 commit 80906b06689bd05c3b727c115242bedd7d6910f2 Author: hanxi <hanxi@chromium.org> Date: Wed May 24 14:38:21 2017 Correctly record WebAPK install source for Launch.HomescreenSource In this CL: 1) Introduces source WEBAPK_UNKNONW for WebAPKs whose source info are lost. 2) Stores the WebAPK's source info after the install is either succeeded or timed out. 3) Retrives the source info from WebappDataStorage when the WebAPK is launched, and records the launch metrics after the source is avaiable. BUG= 711147 Review-Url: https://codereview.chromium.org/2860193002 Cr-Commit-Position: refs/heads/master@{#474285} [modify] https://crrev.com/80906b06689bd05c3b727c115242bedd7d6910f2/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java [modify] https://crrev.com/80906b06689bd05c3b727c115242bedd7d6910f2/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInstaller.java [modify] https://crrev.com/80906b06689bd05c3b727c115242bedd7d6910f2/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java [modify] https://crrev.com/80906b06689bd05c3b727c115242bedd7d6910f2/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java [modify] https://crrev.com/80906b06689bd05c3b727c115242bedd7d6910f2/chrome/browser/android/shortcut_info.h [modify] https://crrev.com/80906b06689bd05c3b727c115242bedd7d6910f2/chrome/browser/android/webapk/webapk_installer.cc [modify] https://crrev.com/80906b06689bd05c3b727c115242bedd7d6910f2/tools/metrics/histograms/enums.xml
,
May 26 2017
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by pkotw...@chromium.org
, Apr 13 2017