ActivationPal

Funnel analysis Python: app stages

def read_count(label):
    while True:
        raw = input(f"{label} count: ").strip()
        try:
            value = int(raw)
        except ValueError:
            print("Enter a whole-number count.")
            continue
        if value < 0:
            print("Counts cannot be negative.")
            continue
        return value


stages = [("Installed cohort (first_open)", read_count("Installed cohort"))]

while input("Add an onboarding step? [y/N] ").strip().lower() == "y":
    step_id = input("Step id: ").strip()
    if not step_id:
        print("Enter the step id shown for that onboarding row.")
        continue
    stages.append((f"Onboarding step: {step_id}", read_count(step_id)))

stages.append(("Onboarding completed", read_count("Onboarding completed")))

if input("Does this funnel include paywall stages? [y/N] ").strip().lower() == "y":
    stages.extend([
        ("Paywall shown", read_count("Paywall shown")),
        ("Plan selected", read_count("Plan selected")),
        ("Purchased", read_count("Purchased")),
    ])

for (source, source_count), (target, target_count) in zip(stages, stages[1:]):
    rate = None if source_count == 0 else target_count / source_count * 100
    difference = source_count - target_count
    rate_text = "N/A" if rate is None else f"{rate:.1f}%"
    print(f"{source} -> {target}: {rate_text}; count difference {difference}")

Enter one app’s installed cohort, observed onboarding step counts in index order, completion count, and any paywall counts shown for the same reporting range. Use step counts rather than answer totals; ActivationPal’s onboarding funnel analytics provides these stage counts, and the event guide lists the events behind them.

Compare funnel stage counts

The rate is target count divided by source count; the difference is source minus target. ActivationPal reports unique-device reach counts per stage, so these comparisons do not establish that the same devices moved between stages.

To see ActivationPal’s product, visit the homepage.

Frequently asked questions

Does this script need extra Python packages?

No. It uses only Python’s built-in features.

Does the script send my counts to ActivationPal?

No. It prompts for counts in your terminal and prints the calculations there.