Created
January 14, 2019 12:36
-
-
Save arafathusayn/080227c983273afe0c443ec1fc4c7346 to your computer and use it in GitHub Desktop.
From Google Play Console, this script will get the name list of the active device models and the number of installs for each in JSON format in clipboard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Instructions: | |
* Go to "Google Play Console" > "Statistics" > click on the dropdown beside "Select" and choose "Device" ... | |
* Then click "Add Device" and you can read the list of active devices and the number of installs ... | |
* After that, run the script in the browser console and you'll see a table after a while and the JSON data will be copied. | |
*/ | |
const spans = document.querySelectorAll('[aria-label*="device :"]') | |
const data = [] | |
let skipFirstOne = true | |
for (const span of spans) { | |
if (skipFirstOne) { | |
skipFirstOne = false | |
continue | |
} | |
const tr = span.closest('tr') | |
const trText = tr.innerText.trim() | |
const trTextArray = trText.split("\n") | |
const name = trTextArray[0] | |
const installs = parseInt(trTextArray[1]) | |
data.push({ name, installs }) | |
} | |
console.table(data) | |
copy(data) // Browser console specific |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hints in Screenshot: