Skip to main content

Shared Links

Track and analyze links created by your app users through the mobile SDK.

Overview

When your app has a "Share" button that creates short links via the SDK, those links appear on the Shared Links page in your dashboard. This gives you visibility into:

  • Which users share the most
  • What content gets shared
  • How many clicks shared links receive
  • Sharing trends over time

Shared Links are separate from marketing links you create in the dashboard or via the API. They have their own dedicated page with sharing-specific analytics.

Prerequisites

Before your app can create shared links:

  1. Integrate a mobile SDK -- see React Native, Expo, iOS, or Android
  2. Configure an API key in your SDK initialization
  3. Create at least one link template -- the SDK uses your default template, or you can pass a specific templateId

How It Works

  1. A user taps "Share" in your app
  2. Your app calls createLink() with an externalUserId identifying the user and deepLinkParameters describing the content
  3. The server creates a short link (or returns an existing one if this user already shared this content)
  4. Your app shares the returned URL
  5. The link and its analytics appear on the Shared Links dashboard

Per-User Deduplication

When both externalUserId and deepLinkParameters are provided, the SDK endpoint automatically deduplicates links:

  • Same user + same content = returns the existing link (no duplicate created)
  • Different user + same content = creates a new link (enables per-user attribution)
  • Same user + different content = creates a new link

When an existing link is returned, the response includes deduplicated: true. This lets your app know no new link was created.

Why per-user deduplication matters

Without deduplication, a user tapping "Share" 10 times on the same product creates 10 identical links. With deduplication, they always get the same link -- keeping your dashboard clean and enabling accurate per-user share analytics.

Deduplication is only active when both externalUserId AND deepLinkParameters are provided. If either is missing, a new link is always created.


Set the User ID

Call setExternalUserId() once after the user logs in. The SDK automatically attaches it to all createLink() calls:

// React Native / Expo
LinkForty.setExternalUserId(currentUser.id);

// On logout
LinkForty.setExternalUserId(null);
// iOS
LinkForty.shared.setExternalUserId(currentUser.id)

// On logout
LinkForty.shared.setExternalUserId(nil)
// Android
LinkForty.shared.setExternalUserId(currentUser.id)

// On logout
LinkForty.shared.setExternalUserId(null)

Once the user ID is set, createLink() includes it automatically:

React Native / Expo

import LinkForty from '@linkforty/mobile-sdk-react-native';
// or: import { LinkForty } from '@linkforty/mobile-sdk-expo';

const result = await LinkForty.createLink({
deepLinkParameters: { route: 'PRODUCT', id: '456' },
title: 'Check out this product',
});

if (result.deduplicated) {
console.log('Returning existing link for this user + content');
}

// Share result.url with the user
await Share.share({ url: result.url });

You can also pass externalUserId per-call to override the SDK-level value:

const result = await LinkForty.createLink({
externalUserId: specificUser.id, // overrides SDK-level value
deepLinkParameters: { route: 'PRODUCT', id: '456' },
});

iOS (Swift)

let result = try await LinkForty.shared.createLink(options: CreateLinkOptions(
deepLinkParameters: ["route": "PRODUCT", "id": "456"],
title: "Check out this product"
))

if result.deduplicated == true {
print("Returning existing link for this user + content")
}

// Share result.url

Android (Kotlin)

val result = LinkForty.shared.createLink(
CreateLinkOptions(
deepLinkParameters = mapOf("route" to "PRODUCT", "id" to "456"),
title = "Check out this product"
)
)

if (result.deduplicated == true) {
println("Returning existing link for this user + content")
}

// Share result.url

Dashboard

Navigate to Shared Links in the left sidebar to view your sharing analytics.

Summary Stats

Four cards at the top of the page show:

StatDescription
Total shared linksTotal number of links created via the SDK
Unique sharersNumber of distinct externalUserId values
Total clicksCombined click count across all shared links
Shares todayLinks created via the SDK today

Top Sharers

Below the stats, a row of clickable chips shows your top 10 sharers ranked by link count. Each chip displays the user's external ID, number of links created, and total clicks received. Click a chip to filter the table to that user.

The table shows all SDK-created links with the following columns:

ColumnDescription
UserThe externalUserId passed when creating the link
ContentDeep link parameters (shown as key-value badges)
Short LinkThe generated short code with a copy button
ClicksTotal click count for this link
CreatedWhen the link was created

Filtering

Use the User filter pill to search by external user ID. The search matches partial user IDs.


Best Practices

Use Stable User IDs

Pass a persistent, unique identifier as externalUserId -- such as a database user ID or Firebase UID. Avoid transient values like session IDs or anonymous tokens, as these break deduplication and make the top sharers list meaningless.

Deep link parameters serve two purposes: they route users to the right content after install, and they're part of the deduplication key. Without them, deduplication won't activate.

// Good -- deduplication works, content is identifiable
await LinkForty.createLink({
externalUserId: user.id,
deepLinkParameters: { productId: '123', category: 'shoes' },
});

// Less useful -- no deduplication, content unknown in dashboard
await LinkForty.createLink({
externalUserId: user.id,
});

Use Descriptive Parameter Keys

The deep link parameters appear in the Shared Links table as badges. Use human-readable keys so your team can identify what content was shared at a glance.