# Aptabase Analytics for C++ Apps

Aptabase is an open source, privacy-first alternative to Google Firebase Analytics for C++ Apps: it collects no personal data, uses no cookies or device identifiers, and needs no consent banner.

## Get started

1. Register: [European Union](https://eu.aptabase.com/auth/register) or [United States](https://us.aptabase.com/auth/register) — takes less than a minute, no credit card required.

2. Create an app in the dashboard and copy its App Key from the **Instructions** menu (`A-EU-*` / `A-US-*`).

3. Instrument your app with the [C++ SDK for Aptabase](https://github.com/aptabase/aptabase-cpp) — see the quickstart below.

4. Explore: events show up on your dashboard in real time.

## Quickstart: C++

Package: `CMake subdirectory`
Install: `add_subdirectory(path/to/aptabase-cpp)`
Repo: https://github.com/aptabase/aptabase-cpp

### CMake integration

Choose a networking backend:

```cmake
# Option A: cpp-httplib
set(CMAKE_APTABASE_USE_HTTPLIB ON)
add_subdirectory(path/to/aptabase-cpp)

# Option B: Boost.Asio
set(CMAKE_APTABASE_USE_BOOST ON)
add_subdirectory(path/to/aptabase-cpp)
```

### Initialization and tracking

```cpp
#include <aptabase/analytics.hpp>
#include <aptabase/net/httplib.hpp>

int main() {
    Aptabase::Analytics aptabase(
        std::make_unique<Aptabase::HttplibHttpClient>(),
        "<YOUR_APP_KEY>",
        "https://your.aptabase.url",
        true // is_debug
    );

    aptabase.StartSession();
    aptabase.RecordEvent("app_started");
    aptabase.RecordEvent("screen_view", {{"name", "Settings"}});
    aptabase.EndSession();
}
```

Event attributes support `std::string`, `float` and `double`.

### How the SDK behaves

- Nothing is tracked automatically — you call the track function for each event.
- Every event is enriched automatically with OS name/version, app version and locale.
- Custom property values must be strings or numbers.
- Tracking calls are non-blocking and run in the background.
- Events are separated into Debug and Release build modes automatically (see https://aptabase.com/docs/build-modes).

## Why add analytics to your C++ Apps?

- **Feature Usage** — Are you aware of the features in your app that users engage with most frequently? What configurations that majority of your users prefer? Gaining insights into these areas allows you to make well-informed decisions on future focus points for enhancing your C++ app's user experience.
- **Growth and Adoption** — Native C++ applications may lag in user updates due to the need for manual intervention during the update process. However, with Aptabase, you can swiftly determine the adoption rate of your app's newest version. This vital information aids you in making strategic decisions regarding the appropriate timing to phase out older versions.
- **Which OS versions do my users have?** — Aptabase efficiently gathers data such as the names of operating systems such as Windows, macOS and various Linux distributions, and their respective versions. This valuable insight enables you to concentrate on crafting enhanced user experiences tailored to the most widely used OS and versions.

## Privacy

- Sessions are completely anonymous and untraceable. Data is never linked to an identifiable individual — no pseudonymisation, full anonymisation.
- No device identifiers, cookies, fingerprinting or long-term user identification.
- Aptabase collects no personal data, so your app stays compliant with strict privacy regulations without a consent banner.

## Pricing

Free up to 20,000 events/month. Paid plans from $10/month for 200,000 events up to $450/month for 50,000,000 events. No overage fees. Details: https://aptabase.com/pricing

More: [Documentation](https://aptabase.com/docs) · [All SDKs](https://aptabase.com/integrations) · [SDK reference](https://aptabase.com/llms-full.txt) · [About](https://aptabase.com/about)
