ViewsBaseViewsBase

Integrations

How tracking, Discord, referral attribution, and revenue webhooks work.

ViewsBase tracks TikTok and Instagram posts for internal creators and competitor/reference monitoring. Discord is optional and is used for creator self-submission.

Refresh Schedule

Active tracked posts refresh every 6 hours.

Watched accounts are also checked on the 6-hour schedule. Recently finalized and paid posts can continue refreshing for analytics, but finalized payable views remain frozen.

TikTok

TikTok tracking supports internal creator posts, competitor/reference posts, and watched accounts.

What Gets Tracked

ViewsBase fetches:

  • Views
  • Likes
  • Comments
  • Shares
  • Post URL and platform post ID
  • Source author handle and display name when available
  • Source avatar, thumbnail, and caption when available

How TikTok Posts Are Added

TikTok posts can enter a campaign through:

  • Discord /submit-post for registered internal creators
  • Posts -> Track Videos for internal creator URLs
  • Intelligence -> Track Video for competitor/reference URLs
  • Watch Account for optional account-level discovery

Internal posts must match an active campaign creator. Competitor/reference posts do not require a creator record.

TikTok Watched Accounts

When watching a TikTok account, choose an initial import:

  • No recent posts
  • Last 5 posts
  • Last 10 posts
  • Last 15 posts
  • Last 30 posts

After that, the account is checked every 6 hours unless paused.

Instagram

Instagram tracking supports internal creator posts, competitor/reference posts, and watched accounts.

What Gets Tracked

ViewsBase fetches:

  • Views when available
  • Likes
  • Comments
  • Post URL and shortcode
  • Source author handle and display name when available
  • Source avatar, thumbnail, and caption when available

Instagram does not provide the same public engagement surface as TikTok, so shares are not tracked.

Reels vs Slideshows

Watched Instagram accounts import Reels only. Slideshows and multi-image posts can lack public view counts, so they are not auto-watched.

If a tracked Instagram post has no public views, admins can enter manual views only when platform views are unavailable. Manual view updates require an audit note.

Discord Bot

The Discord bot lets registered internal creators submit their own posts with /submit-post.

The bot:

  • Checks the campaign/server allowlist
  • Extracts the platform handle from the post
  • Verifies that the creator is active in the campaign
  • Rejects submissions from unknown or paused creators
  • Creates the post in Posts with fetched stats when available

See Discord Bot for setup and command details.

Referral Attribution

Referral attribution is a campaign extension and is off by default. Enable it in Campaign Settings → Referral Attribution. Each active campaign creator can then claim one memorable six-character code in their portal. Codes contain only letters and numbers, are unique within the campaign, and cannot be changed after the creator confirms them. ViewsBase also reveals a campaign-specific webhook credential once.

Send every request to the displayed webhook URL with:

Authorization: Bearer YOUR_SECRET
Content-Type: application/json

Record a code use

{
  "event_id": "code-use-01JZ...",
  "type": "code_used",
  "external_user_id": "customer-123",
  "code": "LOOKS1",
  "occurred_at": "2026-07-17T12:00:00Z"
}

install is also accepted as the type. Unknown codes deliberately return the same 200 {"accepted":true} response as known codes, but create no creator credit. The first valid code recorded for a customer wins.

Record revenue

{
  "event_id": "purchase-01JZ...",
  "type": "purchase",
  "external_user_id": "customer-123",
  "amount": 9.99,
  "currency": "USD",
  "transaction_id": "store-transaction-456",
  "product_id": "pro_monthly",
  "environment": "production",
  "occurred_at": "2026-07-17T12:05:00Z"
}

Revenue types are purchase, renewal, refund, and refund_reversal. Amounts are positive in the request; ViewsBase subtracts refunds. Event IDs must be stable and unique because retries are idempotent. Commission applies to each customer's first purchase only — send renewal for recurring charges so total revenue stays accurate, but renewals are never commissioned. Refunds and refund reversals must use the original purchase's transaction_id, so an adjustment is only credited when its purchase was credited. Revenue is shown separately by currency rather than converted with an assumed exchange rate.

ViewsBase safely holds revenue that arrives before its code-use event and reconciles it later. A transaction that occurred before the first valid code-use is never credited, even if its webhook arrives afterward.

The external_user_id must be the same stable, non-email customer ID on the code-use and revenue events. If RevenueCat is the purchase source, set its App User ID to that value before purchase or ensure the value appears in the event's aliases.

RevenueCat

RevenueCat can post its native webhook payload directly to the ViewsBase URL. In RevenueCat Integrations → Webhooks, use Bearer YOUR_SECRET as the complete Authorization header value, select the one app represented by the ViewsBase campaign, and send production events. Enable only:

  • INITIAL_PURCHASE
  • RENEWAL
  • NON_RENEWING_PURCHASE
  • CANCELLATION
  • REFUND_REVERSED

ViewsBase records initial purchases, renewals, and non-renewing purchases, but commission covers only each customer's first paid transaction. A RENEWAL with is_trial_conversion counts as that first purchase (the trial start itself carries no money); ordinary renewals add to tracked revenue without earning commission, so RENEWAL must stay enabled. CANCELLATION subtracts revenue only when cancel_reason is CUSTOMER_SUPPORT; an ordinary unsubscribe is not a refund. REFUND_REVERSED adds a previously refunded App Store transaction back. RevenueCat Paywall events, expiration, billing issue, product change, and ordinary cancellation do not affect referral totals and do not need to be enabled.

RevenueCat sends the native { "api_version": "1.0", "event": { ... } } payload automatically; the app backend should not construct it. ViewsBase uses the gross price_in_purchased_currency and currency, falling back to the documented USD price. Free-trial events and provider events without usable money, identity, environment, or transaction fields are accepted without changing totals. No RevenueCat API key is stored in ViewsBase.

RevenueCat only emits a subscription refund webhook when the latest subscription period is refunded. Refunds of older periods require separate financial reconciliation if lifetime net revenue must be exact.

AppsFlyer (optional)

AppsFlyer Push API can send install or deep-link attribution directly to the same endpoint. Configure its Authorization value as Bearer YOUR_SECRET, set customer_user_id to the shared customer identity, and put the creator code in referral_code, af_sub1, deep_link_value, or JSON event_value.

AppsFlyer is optional and never supplies referral revenue in ViewsBase; RevenueCat or the generic revenue contract remains the source of truth. This avoids counting the same purchase twice. AppsFlyer's dashboard test message does not include the configured Authorization header, so validate with a real event or a direct authenticated request.

Internal vs Competitor Tracking

BehaviorInternal CreatorCompetitor/Reference
Needs campaign creatorYesNo
Main tabPostsIntelligence
Included in paymentsYes, when finalizedNo
Included in reportsYesNo
Can use watched accountsYesYes
Creator pause affects trackingYesNo

Error Handling

Platform tracking can fail when a post is private, deleted, malformed, rate-limited, or unavailable from the provider.

ViewsBase handles these failures at the affected row or account:

  • Other rows in the same bulk tracking request can still succeed
  • Failed video stat fetches show retry actions
  • Failed watched account syncs show the account error and keep the account saved
  • Paused watched accounts are not synced until resumed

Automatic Lifecycle Actions

Internal creator posts follow the Video Lifecycle:

  • Active posts refresh during the counting window
  • Posts under the auto-reject minimum can be rejected after the window
  • Posts with complete terms can finalize
  • Posts without complete terms move to Pending CPM
  • Finalized payable views are frozen

Competitor/reference posts refresh for intelligence only and do not enter the payment lifecycle.

On this page