Create Free APK

Backend and accounts

Analytics, Facebook login & subscriptions - setup

Firebase Analytics, Facebook Login and RevenueCat, step by step

1What this card connects#

The Integrate step has a card called Sign-in, analytics & subscriptions. It connects YOUR OWN accounts:

  • Firebase Analytics: who uses the app and what they do
  • Facebook Login: a Continue with Facebook button, plus Meta App Events
  • RevenueCat: subscriptions and purchases

Each switch is separate. Turn on only what you use; an app with every switch off builds exactly as before.

2Firebase Analytics: create or choose a project#

Open the Firebase console and tap Create a project (or pick the project your app already uses for push). Keep Google Analytics turned ON when asked, and choose or create an Analytics account.

Already have a project without Analytics? Project settings → Integrations → Google Analytics → Enable.

3Firebase Analytics: add your Android app#

In the project, tap Add app → Android.

  • Android package name: type the EXACT package name from the Basic step of the wizard, for example com.yourname.myapp. One wrong letter and no data arrives.
  • The nickname is optional, and the SHA-1 is not needed for analytics.

Tap Register app, then Download google-services.json. You can skip the remaining Firebase steps; AppMint adds the SDK for you.

Changed the package name later? Add the new package as another Android app and download the file again.

4Firebase Analytics: turn it on in the wizard#

Integrate step → Sign-in, analytics & subscriptions → turn on Firebase Analytics. The google-services.json upload then appears in the Push Notifications card: upload the file there. It is the same file push uses, so if you already uploaded it for push, you are done.

Log a screen view for every page change: when this is on, the app records a screen_view each time your page changes route (links, history changes, back and forward, # changes), with the path and the page title. You see which screens people use without writing any code. Leave it off if your page sends its own screenView calls, or screens are counted twice.

5Send your own events#

AppMint.analytics.log(name, params) records one event. Names use letters, digits and _ (up to 40 characters, starting with a letter). The answer says what was sent, or why not: no_consent, not_configured, invalid_name, reserved_name.

setUserId tags events with your own user id (never an e-mail), setUserProperty sets a property such as plan, and screenView records a screen yourself. With Meta App Events on, log sends the same event to Meta too.

if (window.AppMint && AppMint.analytics) {
  AppMint.analytics.setUserId('u_42');
  AppMint.analytics.setUserProperty('plan', 'pro');
  const r = await AppMint.analytics.log('add_to_cart', { item_id: 'sku-42', value: 19.99, currency: 'USD' });
  if (!r.ok) console.warn('not logged', r.providers);
  AppMint.analytics.screenView('Checkout', 'CheckoutPage');
}

6Where the data appears#

Firebase console → Analytics. Realtime shows users and events within a few minutes of opening the app. The Dashboard and Events reports fill in within about 24 hours, so an empty report on the first day is normal.

To watch every event live while testing, connect the phone to a computer and run the command below, then open the app and go to Analytics → DebugView. Use your own package name.

adb shell setprop debug.firebase.analytics.app com.yourname.myapp
# turn it off again:
adb shell setprop debug.firebase.analytics.app .none.

In an app that shows ads, Google's consent form decides for analytics too: nothing is collected until the user has answered it, and where the GDPR applies the user must agree. Until then calls answer no_consent and nothing is queued.

Your page can always switch collection off: AppMint.analytics.setEnabled(false) stops it and is remembered, setEnabled(true) turns it back on. Mention analytics in your privacy policy and in Play's Data safety form.

document.getElementById('optOut').onchange = (e) =>
  AppMint.analytics.setEnabled(!e.target.checked);

8Facebook Login: create the Facebook app#

Open Meta for Developers → My Apps → Create app. Choose the use case for signing people in with Facebook Login (or add the Facebook Login product to an app you already have). Give it a name and your contact e-mail.

9Facebook Login: add the redirect URL#

Facebook Login → Settings → Valid OAuth Redirect URIs: add
https://freewebtoapk.com/fb-return/
exactly, including the last slash. The wizard has a Copy redirect URL button so you do not have to type it. Keep Client OAuth login and Web OAuth login on, then Save changes.

No key hash and no Android platform setup are needed: the sign-in opens in a browser tab and comes back to your app.

10Facebook Login: App ID and Client Token#

App settings → Basic shows the App ID. App settings → Advanced → Security shows the Client token. Paste both into the Facebook Login fields of the wizard.

While the Facebook app is in Development mode, only people with a role on it (you and your testers) can sign in. Before you publish, add a privacy policy URL and an icon in App settings → Basic and switch the app to Live.

11Facebook Login: sign people in#

AppMint.facebook.login(permissions) opens Facebook and resolves with the token, or with ok: false and cancelled when the user backs out. Send the token to your server and check it there. getAccessToken() returns the saved token when the page starts; logout() signs out.

Turn on Meta App Events to send installs, app opens and your own events to Meta Events Manager. AppMint.facebook.logEvent(name, valueToSum, params) sends to Meta only; it follows the same consent rule as analytics.

const r = await AppMint.facebook.login(['public_profile', 'email']);
if (r.ok) {
  await fetch('/api/login/facebook', { method: 'POST', body: JSON.stringify({ token: r.accessToken }) });
} else if (!r.cancelled) {
  alert('Facebook sign-in failed: ' + (r.message || r.error));
}
AppMint.facebook.logEvent('fb_mobile_purchase', 9.99, { fb_currency: 'USD' });

12RevenueCat: create the project and connect Google Play#

In RevenueCat, create a project and add an app for the Google Play Store. Enter the EXACT package name from the Basic step.

RevenueCat checks purchases with Google through a service account: follow RevenueCat's own guide to create it in Google Cloud, invite it in Play Console with the financial permissions it lists, and upload its JSON credentials to the RevenueCat app. Google can take a day or more before the new credentials work.

13RevenueCat: products, entitlement and offering#

  1. In Play Console create your subscriptions or in-app products (the app must be uploaded to a testing track first).
  2. In RevenueCat → Product catalog, add the same product ids.
  3. Create an Entitlement, for example pro, and attach the products that unlock it.
  4. Create an Offering (the default one is shown as current) with packages such as Monthly and Annual that point at those products.

Your page reads the current offering to draw the paywall, and checks the entitlement to unlock features.

14RevenueCat: the public Google key#

RevenueCat → Project settings → API keys: copy the PUBLIC key of your Google Play app. It starts with goog_. Paste it into the RevenueCat field of the wizard.

Never use a secret key (sk_...). Anything inside an app can be read by anyone who downloads it, and a secret key gives full control of your RevenueCat account.

15RevenueCat: offerings, purchases and entitlements#

configure() starts RevenueCat (pass your own user id, or nothing for an anonymous user). getOfferings() returns the paywall, purchase(package) runs the Google Play purchase, and getCustomerInfo() says what the user owns. restore() brings back earlier purchases. Test with a license tester account and an install from a Play testing track.

if (window.AppMint && AppMint.revenuecat) {
  await AppMint.revenuecat.configure({ appUserId: 'u_42' });
  const off = await AppMint.revenuecat.getOfferings();
  if (off.ok && off.current) {
    const pkg = off.current.availablePackages[0];
    const r = await AppMint.revenuecat.purchase(pkg);
    if (r.ok) unlock();
  }
  const info = await AppMint.revenuecat.getCustomerInfo();
  const isPro = info.ok && !!info.customerInfo.entitlements.active.pro;
}

This page is generated from the Integration Guide inside the app itself, so it says exactly what the current build says. Read it as Markdown.

Checked against the shipped guide on 2026-10-02.