A free trial that restarts every time someone reinstalls the extension is not really a trial. It is a loophole, and it shows up later in your numbers. This article covers why trials kept in extension storage reset, how to tie a trial to a confirmed email on the server, how ExtCharge implements that, and where to decide the trial length.
Why storage-based trials reset
The most common first version looks like this:
chrome.runtime.onInstalled.addListener(() => {
chrome.storage.local.set({ trialStart: Date.now() });
});
It works in testing and fails in production. The value lives in the browser profile, and users can remove it in several ways:
- Clearing the extension's data or site data.
- Removing and reinstalling the extension. Uninstalling deletes
chrome.storage.local. - Switching to another Chrome profile, another browser or another computer.
- Editing the stored value in DevTools, which takes a minute.
Some users do this on purpose. Many more do it by accident, for example during a profile migration. Your trial clock then measures how long a user has kept the same browser profile, not how long they have used your product.
chrome.storage.sync carries values between signed-in browsers, but it is still client data and it can still be cleared. It does not fix the problem.
Bind the trial to a confirmed email
A trial that the server starts, tied to an email address the user has confirmed, moves the clock out of the browser. Each email gets one trial. A user with a second email can start another, so the limit is not perfect. The goal is to make abuse take effort, not to make it impossible. Confirmation also gives you a contact address, which a storage counter never does.
The trade-off is friction. Some users will not click the link, and some will read your confirmation mail as a sales message. Accept that cost on purpose and measure it.
How ExtCharge implements it
The trial flow has three parts. The extension calls openTrialPage(), which opens a hosted page where the user enters an email address. The service sends a confirmation link. When the user confirms it, the server sets trialStartedAt for that install. The extension reads the value with getUser(), and the background script can react to the start with an onTrialStarted listener.
// popup.js
const extcharge = ExtCharge("your-extension-id");
document.querySelector("#try").onclick = () => extcharge.openTrialPage("7-day");
The "7-day" argument only changes the heading of the hosted page, so it reads "Start your 7-day free trial". It does not set the length. The length is your code's decision, which is the next section.
Decide the trial length in code
The server records when the trial started. Your extension decides how long it lasts. One helper keeps that logic in one place:
const TRIAL_DAYS = 7;
const DAY_MS = 86400e3;
function trialDaysLeft(user) {
if (!user.trialStartedAt) return 0;
const end = new Date(user.trialStartedAt).getTime() + TRIAL_DAYS * DAY_MS;
return Math.max(0, Math.ceil((end - Date.now()) / DAY_MS));
}
The gate then uses it:
const user = await extcharge.getUser();
if (user.paid || trialDaysLeft(user) > 0) {
enablePro();
} else {
showUpgrade();
}
Two notes. First, the expiry check runs in the extension, so a determined user can change it. What they cannot do with that change is start a second trial, because the start time is set on the server. If the length itself must be enforced by a server, you need an endpoint that answers the question, which is the DIY route described in our article on accepting payments in a Chrome extension. Second, wrapping the value in new Date() makes the arithmetic work whether it arrives as a Date or as a string.
What happens when the trial ends
- Show the end date, not only the word "trial". Users who know when the trial ends are less surprised when it does.
- Warn before the end, once or twice, where the user already looks. A line in the popup is enough. A full-screen block in the last days reads as a trap.
- Keep the user's data. Do not delete or lock files, settings or history when the trial ends. Limit the premium features, not what the user already made.
- Make the upgrade one click. Call
openPaymentPage(), optionally with a plan name, so the user lands where they can pay.
UX tips for asking for an email
- Ask at the moment of value. Show the email step when the user first tries a Pro feature, not on install.
- Say what the email is for. Confirmation, license recovery on another device, or marketing mail. Name only the uses you actually have.
- Tell the user what to do next. Say to check the inbox, and what to do if the link does not arrive within a few minutes.
- Do not require a card unless you need one. A trial that asks for a card up front is a different trade-off, with its own conversion behaviour. Test it separately instead of assuming the result.
- Measure by cohort. Track trial starts, expirations and conversions per week or per source. A trial with a lower conversion rate can still earn more if it brings in more starts. Compare revenue per trial start, not the conversion rate alone.
The short version
Keep the trial clock on the server and bind it to a confirmed email. Keep the length in one function in your extension. Accept the friction and measure it. The trade-off is never zero: a storage counter is free to build and easy to reset, and a server-side trial needs an email step and a backend. Choose the one that matches how much abuse you can tolerate.
ExtCharge does the server side with openTrialPage() and trialStartedAt. The full setup is in the integration guide.