---
url: https://simpledatalogs.com/docs/guide/share-links.md
description: >-
  Count how many people your users' shared links brought in, and which installs
  came from which share, with share_id and app_installed.
---

# Share links and installs

When your app lets people share a link, simpledatalogs can tell you how many shares there were, how many links were opened, and which installs came from a share.

## What to send

| Where | Event | Props |
|---|---|---|
| Your app, when someone shares | `app_shared` (any name you like) | `share_id`: a random id you make per share, also put on the link |
| Your share page, in the browser | any event, such as `share_card_view` | `share_id` read from the link |
| Your app, on its first launch | `app_installed` | nothing extra, or `install_referrer` on Android |

Make the share id short and random, such as 8 letters and digits (`A-Z`, `a-z`, `0-9`, `_`, `-`, up to 64). Never use a device id or a user id as the share id.

```text
https://example.com/share/?s=K7F2mQ9x
```

## How an install finds its share

simpledatalogs writes `share_id` and `attribution` onto `app_installed` the moment it arrives. The first match wins:

| `attribution` | When | How exact |
|---|---|---|
| `link` | Your app already put `share_id` on `app_installed`, for example from a deep link | Exact |
| `referrer` | Android: the Play install referrer carries `share_id` (see below) | Exact |
| `ip` | A browser opened a link with that `share_id` from the same IP address within the last 24 hours | A good guess |

The `ip` match works across the projects and environments of one organization, so a share page tracked in your website project matches an install in your app project.

It is a guess: people on the same Wi-Fi or mobile network share an address, and an install more than a day after the click isn't matched. Link previews (Messages, Slack, WhatsApp) are bots and never count as opens.

## Android: the Play install referrer

Put the share id in the Play Store link's `referrer`:

```text
https://play.google.com/store/apps/details?id=com.example.app&referrer=share_id%3DK7F2mQ9x
```

On the first launch, read it with the SDK and send it on `app_installed`:

```kotlin
SimpleDataLogs.installReferrer(context) { installReferrer ->
    SimpleDataLogs.track("app_installed", mapOf("install_referrer" to installReferrer))
}
```

simpledatalogs reads `share_id` out of the referrer.

## On a board

Add a card with **Which shares bring installs?** (see [Boards](/guide/boards#shares)). It shows the totals in one line, such as "20 shares by 5 users · 12 opened · 2 installs (1 by IP match)", and a table of the sharers who brought the most installs.

Other cards work too:

* **Installs from shares:** a Number of `app_installed` where `share_id` is set, broken down by `attribution`.
* **Best shares:** `app_installed` broken down by `share_id`.

## Privacy

* The IP address is never stored. Ingest keeps only a hash of it, under a salt that changes every day and is deleted the next day.
* That hash is kept for two days, only for browser visits that carry a `share_id`, and never in your events.
* Projects with **No device IDs** turned on get no hash, so their installs are matched only by `link` or `referrer`.
* Say in your privacy policy that an install can be matched to the shared link that led to it.

See [Privacy for senders](/reference/privacy).
