Luka Bulatovic
Luka Bulatovic

Reputation: 357

How many users use my extension?

What I wanna know is the easiest way to know how many people use my extension, and I want to have a daily report, meaning I want each user to notify me that he uses it the first time he starts up the browser on a particular day. I tried caching the date of last notification using localStorage but it is different for different domains, so it doesn't work - everytime user opens new web-site, it notifies me once again. Someone help pls, thanks in advance!

Upvotes: 0

Views: 47

Answers (1)

Xan
Xan

Reputation: 77571

You have 2 options for persistent storage.

1) chrome.storage API. It is available for content scripts that you are obviously using, so little modification will be needed for your code. However, it will need to be restructured, since it's asynchronous.

2) If you add a background page, localStorage in it will bind to your extension's "domain" and will therefore be persistent and unique. This will possibly require more restructuring of how your tracking works.

Upvotes: 1

Related Questions