Track statistics on the stats page and display the stats in charts. Stores the stats in the browser's local storage.
< 脚本 AO3 Statistics Tracker 的反馈
When you click on the "Track" button, does it draw the chart with old data or not at all?
If it doesn't draw the chart, it could be the same issue that I've had sometimes. After I switched from Chrome to Firefox, I've experienced that it's less reliable. My script depends on Chart.js to draw the chart, so these have to be imported. I'm guessing that, for some reason, Firefox struggles more with importing these quickly. I solve the issue by just refreshing the page once.
Possibly, the local storage is full if you have a lot of data stored (can happen if you have hundreds of works and/or using other user scripts that share the same storage), but you're supposed to get an alert then.
When I click track, it does draw the chart but it only has the three data points, though the chart seems accurate for the outdated data- I only have about 14 works so I don't think it would be any sort of issue with local storage. I've tried refreshing the page and the browser. I also do use chrome. Do you think I should try uninstalling/reinstalling the tracker?
You can try reinstalling it, but it would be strange if that solved anything. Have you changed the code at all, to customize something?
Have you posted any new works or something like that since the issue started happening?
If you're on PC, you can check the browser's local storage and see what is saved there for AO3. Does any of the values contain a different date or only the ones you see in the graph? It's also possible to look in the console and see if any errors appear. Here is a guide. To see console, go to the "Console" tab instead of "Application".
I've been posting a work twice a week since, but that's only been for a couple weeks at six chapters in total now- in local storage, there's only the ones for the graph (7/22, 7/23, 7/24) the others don't seem to be in the local data nor are they shown. I haven't changed anything in the code, but the console is showing errors though I'm not sure what they mean- I attached a photo with what I could find.
Unfortunately, none of those are related to my script. That makes it harder to solve.
I was thinking perhaps one of your works have a semicolon in them. Semicolon is what I use to split the data. If you have that, then you can just replace it with another character/symbol that is never used in your work titles (in the code on line 39 there is the "DELIMITER" variable that you can change). Though, I think the data would still show up in local storage. (Note that changing the delimiter means the old data is incompatible. So you could export it, edit the file to replace the old delimiter with the new one, and then import it again).
I can also try to help you debug this, if the above doesn't work. In the code on line 545, after valueNumber, you can add this code: console.log("Get total stats", key, valueNumber);
It should output the stat values you're tracking into the console log (the same place as in your screenshot). If all of these look legit, we know it's not having a problem getting the stat values. On line 584, after setItem, add this code: console.log("Local storage", key, stat.value.toString());
This checks storing the items in the local storage. If these values are kind of as expected (and none of them are "null" or "undefined"), then the issue lies elsewhere, inexplicably.
Last resort would be to use a different browser and see if that works. If it works, then it's an issue with either your script version or another script you use, or potentially the local storage. If the problem persists, it's an issue with your work setup specifically. Something that makes the script silently fail.
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址
The script has only recorded 3 data points- 7/22, 7/23 and 7/24 despite me trying to track stats daily (today is 7/28) do you recommend any fixes for the data points not updating?