Link-in-bio and creator platforms
Every profile tracked, each creator shown their own numbers
You run a platform where every user has a page: a link-in-bio profile, a creator page, a storefront, a portfolio. You want analytics for the whole platform, and you want to show each user their own numbers (views, visitors, which links they clicked) inside your product. Viakite counts everything with one install, and your backend reads each user's slice through the Query API.
Who it's for
Builders of link-in-bio tools, creator platforms and any product with one public page per user, who want per-user stats without building an analytics pipeline.
What you get
| Feature | What it does | Guide |
|---|---|---|
| One install | Page views, sources, countries and devices for every profile | Install Analytics |
| Custom events with properties | Profile view and Link click, each carrying the profile_id | Custom events |
| Allowed hostnames | Profiles on your subdomains (*.yourplatform.com) all count, nothing else does | Tracking settings |
| The Query API with a secret key | Any report, filtered to one profile with props.profile_id, from your backend | Queries |
| Rate limit headers | How many requests your key has left this second | Authentication |
Set it up
Install once for the platform
Add the snippet from Analytics → Install to the template every profile page uses, once:
profile.html1<script defer src="https://us.api.vk.viabio.me/v1/a.js" data-project="pk_live_us_…"></script>If profiles live on subdomains, add
*.yourplatform.comto the allowed hostnames in Analytics → Analytics settings → Tracking, so only your pages count. With a list set, profiles on creators' own domains need their hostnames added too, or their events are dropped.Tag each profile view
When a profile page loads, send one event with the profile's id. Use your own id, never an e-mail address or a name a person could be found by:
src/profile.ts1import { track } from "@viakite/sdk";23track("Profile view", { profile_id: profile.id });With the script tag, call
viakite.track("Profile view", { profile_id: "prf_8231" }).Page views arrive on their own as well. If every profile has its own path (
/alice), you can also filter page views bypage; theprofile_idevent works whatever the address is, custom domains included.Tag each link click
Send an event when a link is clicked, with the profile and the link:
src/links.ts1import { track } from "@viakite/sdk";23track("Link click", { profile_id: profile.id, link_id: link.id });Or without JavaScript, with classes on the link (a space is written
+):profile.html1<a href="https://youtube.com/@alice"2class="viakite-event-name=Link+click viakite-event-profile_id=prf_8231 viakite-event-link_id=lnk_42">YouTube</a>Links to other sites also send the automatic
Outbound linkevent, with the address clicked. Turn it off withdata-outbound="false"if you only wantLink click.Create a secret key for your backend
In Settings → API keys, create a secret key with only the
analytics.viewscope, limited to this project. Copy the Project ID (prj_…) from Settings → General. Keep the key in your server's environment, for exampleVIAKITE_SECRET_KEY.Read one profile's numbers from your backend
Your endpoint first checks that the signed-in user owns the profile, then asks Viakite. Views and visitors per day, then link clicks by link:
src/profile-stats.ts1const API = "https://us.api.vk.viabio.me/v1/projects/prj_…/analytics/query";23async function query(body: object) {4const res = await fetch(API, {5method: "POST",6headers: { Authorization: `Bearer ${process.env.VIAKITE_SECRET_KEY}`, "Content-Type": "application/json" },7body: JSON.stringify(body),8});9if (!res.ok) throw new Error(`viakite ${res.status}: ${(await res.json()).error?.code}`);10return res.json();11}1213export async function profileStats(profileId: string) {14const views = await query({15measures: ["events", "visitors"],16date_range: { preset: "30d" },17granularity: "day",18filters: [19{ dimension: "props.profile_id", operator: "is", values: [profileId] },20{ dimension: "event_name", operator: "is", values: ["Profile view"] },21],22});23const links = await query({24measures: ["events"],25date_range: { preset: "30d" },26breakdown: ["props.link_id"],27filters: [28{ dimension: "props.profile_id", operator: "is", values: [profileId] },29{ dimension: "event_name", operator: "is", values: ["Link click"] },30],31limit: 50,32});33return { views: views.data, links: links.data };34}views.datahas one row a day,{ "time": "…", "events": 128, "visitors": 97 };links.dataone row a link,{ "props.link_id": "lnk_42", "events": 31 }. Any other dimension works the same way: break down bycountry,sourceordevice_typeto show where a creator's visitors come from.On a Node.js server you can use the query helper of
@viakite/sdkinstead offetch. It refuses to run in a browser, so the key can't leak there:src/profile-stats.ts1import { query } from "@viakite/sdk";23const report = await query(4{ key: process.env.VIAKITE_SECRET_KEY!, project: "prj_…" },5{6measures: ["events"],7date_range: { preset: "7d" },8breakdown: ["props.link_id"],9filters: [10{ dimension: "props.profile_id", operator: "is", values: [profileId] },11{ dimension: "event_name", operator: "is", values: ["Link click"] },12],13},14);Cache the answers
Creators reload their stats often, and many creators share one key's rate limit. Keep each answer in your own cache (memory, Redis, your database) per profile and date range for a few minutes, and serve repeats from there. When Viakite answers
429 rate_limited, wait the seconds itsRetry-Afterheader says before trying again.
What to watch
- Rate limit. Each secret key may make 10 requests a second; on a paid plan the Rate limit card in Settings → API keys raises it to 25, 50 or 100 for every secret key of the organization. Every answer carries
RateLimit-Limit,RateLimit-RemainingandRateLimit-Reset. Sending events is not counted. See API keys. - Filters match events. A
props.profile_idfilter keeps only the custom events carrying that property, which is why each profile view is sent as its own event. Every such event counts toward your plan's events (1M a month on Free, 5M on Pro). - Visitors are counted per day. Without cookies a visitor id lasts one day, so over 30 days someone who came back on three days counts as three.
- Public pages stay site-wide. A public page or share token shows the whole project's numbers and can't be fixed to one profile. Per-creator numbers go through your backend only.
- Your plan's history. A query reaches back only as far as your plan keeps data: 30 days on Free, a year on Pro.
- Property limits. Up to 20 flat properties an event; keys up to 40 characters of letters, digits,
_,.or-to be usable in a query.