Documentation

Everything you need to install, configure, and use Lynq Studio — for websites, web apps, and mobile apps.

Quick Start

Get Lynq running on your website or app in under 2 minutes.

1

Create an account

Sign up at lynq.studio/signup and add your website or app.

2

Install the tracking code

Add this snippet before the closing </head> tag:

html
<script src="https://YOUR_ENDPOINT/t/lynq.js"
  data-website-id="YOUR_WEBSITE_ID"
  data-endpoint="https://YOUR_ENDPOINT/api/collect">
</script>

Replace YOUR_ENDPOINT and YOUR_WEBSITE_ID with values from your dashboard settings.

3

See data in real-time

Open your dashboard. Data will appear within seconds of the first visit.

Installation Methods

HTML (Standard)

Paste this in your HTML <head>:

html
<script src="https://YOUR_ENDPOINT/t/lynq.js"
  data-website-id="lq_xxxxxxxxxxxx"
  data-endpoint="https://YOUR_ENDPOINT/api/collect">
</script>

Google Tag Manager

Create a new Custom HTML tag:

html
<script>
  (function(){
    var s = document.createElement('script');
    s.src = 'https://YOUR_ENDPOINT/t/lynq.js';
    s.dataset.websiteId = 'lq_xxxxxxxxxxxx';
    s.dataset.endpoint = 'https://YOUR_ENDPOINT/api/collect';
    document.head.appendChild(s);
  })();
</script>

Set the trigger to All Pages — Page View.

Next.js / React

jsx
// app/layout.tsx or _app.tsx
import Script from 'next/script';

export default function Layout({ children }) {
  return (
    <html>
      <head>
        <Script
          src="https://YOUR_ENDPOINT/t/lynq.js"
          data-website-id="lq_xxxxxxxxxxxx"
          data-endpoint="https://YOUR_ENDPOINT/api/collect"
          strategy="afterInteractive"
        />
      </head>
      <body>{children}</body>
    </html>
  );
}

WordPress

Add to your theme's functions.php:

php
function lynq_tracking() {
  echo '<script src="https://YOUR_ENDPOINT/t/lynq.js"
    data-website-id="lq_xxxxxxxxxxxx"
    data-endpoint="https://YOUR_ENDPOINT/api/collect"></script>';
}
add_action('wp_head', 'lynq_tracking');

Shopify

Go to Online Store → Themes → Edit code → theme.liquid and paste the HTML snippet before </head>.

Event Tracking

Lynq automatically tracks page views and sessions. For custom events, use the global lynq() function.

Basic Event

javascript
lynq('track', 'button_click', {
  button_name: 'Sign Up',
  page: '/pricing'
});

Event Parameters

ParameterTypeDescription
event_typestringRequired. Name of the event.
paramsobjectOptional. Key-value pairs. Max 20 params per event.
valuenumberOptional. Numeric value (e.g., revenue).
currencystringOptional. ISO currency code (e.g., "TRY", "USD").

Common Events

javascript
// Form submission
lynq('track', 'form_submit', { form_name: 'Newsletter' });

// Video play
lynq('track', 'video_play', { video_title: 'Product Demo', duration: 120 });

// File download
lynq('track', 'file_download', { file_name: 'whitepaper.pdf' });

// Search
lynq('track', 'search', { search_term: 'analytics', results_count: 12 });

// Login
lynq('track', 'login', { method: 'google' });

E-Commerce Tracking

Track the full purchase funnel: product views, cart actions, and purchases.

Product View

javascript
lynq('track', 'view_item', {
  item_id: 'SKU-12345',
  item_name: 'Wireless Headphones',
  item_brand: 'AudioTech',
  item_category: 'Electronics',
  price: 299.99,
  currency: 'TRY'
});

Add to Cart

javascript
lynq('track', 'add_to_cart', {
  item_id: 'SKU-12345',
  item_name: 'Wireless Headphones',
  quantity: 1,
  price: 299.99,
  currency: 'TRY'
});

Purchase

javascript
lynq('track', 'purchase', {
  transaction_id: 'T-98765',
  items: [
    { item_id: 'SKU-12345', item_name: 'Wireless Headphones', quantity: 1, price: 299.99 },
    { item_id: 'SKU-67890', item_name: 'Phone Case', quantity: 2, price: 49.99 }
  ],
  value: 399.97,
  currency: 'TRY',
  shipping: 15.00,
  tax: 72.00
});

Full Funnel Events

EventWhen to fire
view_item_listUser views a product category / search results
view_itemUser views a product detail page
add_to_cartUser adds a product to cart
remove_from_cartUser removes a product from cart
begin_checkoutUser starts the checkout flow
add_payment_infoUser submits payment information
purchaseTransaction completes successfully

Attribution Model

Lynq uses a last external touch attribution model. Here's how it works:

1

When a visitor arrives with UTM parameters, those are stored in a first-party cookie (_lynq_attr) with a 90-day lifetime.

2

If the visitor returns via a different paid or organic channel, the cookie is updated with the new source (last external touch).

3

If the visitor returns directly (no referrer), the previous attribution is preserved. Direct visits do not overwrite campaign data.

4

Campaign attribution expires after 30 days of no external touch. After expiry, the visitor is classified as "direct / returning".

UTM Parameters

ParameterExampleUsage
utm_sourcegoogleTraffic source
utm_mediumcpcMarketing medium
utm_campaignsummer_saleCampaign name
utm_termanalytics+toolPaid keyword
utm_contentbanner_v2Ad variation

Referrer Classification

When a visitor arrives without UTMs, Lynq classifies the source from the referrer domain:

Referrer containsSource / Medium
google.com, google.com.trGoogle / organic
instagram.com, l.instagram.comInstagram / social
facebook.com, l.facebook.comFacebook / social
t.co, twitter.com, x.comTwitter / social
linkedin.comLinkedIn / social
Other external domaindomain.com / referral

API Reference

All API endpoints require authentication via JWT Bearer token or Admin API key.

Authentication

bash
# Option 1: JWT Bearer token
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  https://YOUR_ENDPOINT/api/admin/report/pages

# Option 2: Admin API key
curl -H "X-Admin-Key: YOUR_ADMIN_KEY" \
  https://YOUR_ENDPOINT/api/admin/report/pages

Report Endpoints

GET/api/admin/report/pages
GET/api/admin/report/sources
GET/api/admin/report/devices
GET/api/admin/report/geography
GET/api/admin/report/ecommerce
GET/api/admin/report/events
GET/api/admin/report/campaigns
GET/api/admin/report/journey
GET/api/admin/live

Query Parameters

ParamExampleDescription
hours168Relative time range (last N hours)
from2026-02-01Start date (YYYY-MM-DD)
to2026-02-10End date (YYYY-MM-DD)
websiteIdlq_xxxxFilter by website

Data Collection Endpoint

bash
POST /api/collect

Content-Type: application/json

{
  "website_id": "lq_xxxxxxxxxxxx",
  "event_type": "page_view",
  "url": "https://example.com/products",
  "title": "Products — Example Store",
  "referrer": "https://google.com",
  "screen_resolution": "1920x1080",
  "language": "en-US",
  "params": {}
}

Export Endpoint

bash
# Export pages report as CSV
GET /api/export/pages?hours=168&format=csv

# Export sources report as JSON
GET /api/export/sources?from=2026-02-01&to=2026-02-10&format=json

JavaScript SDK (App Tracking)

For React Native, Electron, or Node.js applications.

Installation

bash
npm install @lynq/tracker

Usage

javascript
import { LynqTracker } from '@lynq/tracker';

const tracker = new LynqTracker({
  websiteId: 'lq_xxxxxxxxxxxx',
  endpoint: 'https://YOUR_ENDPOINT/api/collect'
});

// Track screen view
tracker.screenView('HomeScreen');

// Track custom event
tracker.track('button_click', { button: 'Buy Now' });

// Track purchase
tracker.purchase('TXN-123', 299.99, 'TRY', [
  { item_id: 'SKU-1', item_name: 'Product', quantity: 1, price: 299.99 }
]);

iOS SDK (Swift)

Installation

Add via Swift Package Manager:

text
https://github.com/lynq-studio/lynq-ios.git

Usage

swift
import LynqTracker

// Initialize in AppDelegate
LynqTracker.shared.configure(
    websiteId: "lq_xxxxxxxxxxxx",
    endpoint: "https://YOUR_ENDPOINT/api/collect"
)

// Track screen view
LynqTracker.shared.screenView("HomeViewController")

// Track event
LynqTracker.shared.track("add_to_cart", params: [
    "item_id": "SKU-123",
    "price": 299.99
])

// Track purchase
LynqTracker.shared.purchase(
    transactionId: "TXN-456",
    revenue: 299.99,
    currency: "TRY",
    items: [["item_id": "SKU-123", "item_name": "Product"]]
)

Android SDK (Kotlin)

Installation

groovy
// build.gradle
implementation 'studio.lynq:tracker:1.0.0'

Usage

kotlin
import studio.lynq.LynqTracker

// Initialize in Application.onCreate()
LynqTracker.init(
    context = this,
    websiteId = "lq_xxxxxxxxxxxx",
    endpoint = "https://YOUR_ENDPOINT/api/collect"
)

// Track screen view
LynqTracker.screenView("HomeActivity")

// Track event
LynqTracker.track("add_to_cart", mapOf(
    "item_id" to "SKU-123",
    "price" to 299.99
))

// Track purchase
LynqTracker.purchase(
    transactionId = "TXN-789",
    revenue = 299.99,
    currency = "TRY",
    items = listOf(mapOf("item_id" to "SKU-123"))
)

Flutter SDK (Dart)

Installation

yaml
# pubspec.yaml
dependencies:
  lynq_tracker: ^1.0.0

Usage

dart
import 'package:lynq_tracker/lynq_tracker.dart';

// Initialize
final tracker = LynqTracker(
  websiteId: 'lq_xxxxxxxxxxxx',
  endpoint: 'https://YOUR_ENDPOINT/api/collect',
);
await tracker.init();

// Track screen view
await tracker.screenView('HomeScreen');

// Track event
await tracker.track('add_to_cart', params: {
  'item_id': 'SKU-123',
  'price': 299.99,
});

// Track purchase
await tracker.purchase(
  transactionId: 'TXN-012',
  revenue: 299.99,
  currency: 'TRY',
  items: [{'item_id': 'SKU-123', 'item_name': 'Product'}],
);

Dashboard Guide

Your dashboard is organized into focused report pages:

Overview

KPIs, traffic trend, top pages, top sources at a glance.

Pages

All pages, entry pages, exit pages with views, visitors, and sessions.

Sources

Traffic sources with medium, sessions, purchases, revenue, and conversion rate.

Campaigns

UTM campaign performance with sortable metrics and medium filter.

Devices

Browser, OS, screen size, and language breakdowns with visual bars.

Geography

Country and city distribution with flag indicators and drill-down.

E-Commerce

Revenue KPIs, conversion funnel, product performance table.

Events

All event types with counts, users, and values. Filterable by type.

User Journey

Select any user and view their complete event timeline across sessions.

Cohort

Weekly cohort matrix showing user retention over time.

Retention

Daily and weekly retention curves with period-over-period comparison.

Real-time

Live visitors, active pages, and geographic distribution.

Filtering

Every report supports advanced filtering. Click the filter icon and select:

  • Field — what to filter (URL, source, country, etc.)
  • Operator — how to match (contains, equals, starts with, greater than, etc.)
  • Value — what to match against

Multiple filters can be combined. Active filters appear as chips that can be removed individually.

Date Ranges

Use the date picker in the header. Presets available:

  • Today, Yesterday, Last 7 / 14 / 28 / 90 days
  • Custom range (select start and end dates on the calendar)

Export

Every report has an export button. Click it to download the current data as a CSV file for use in spreadsheets or BI tools.

Privacy & GDPR

Lynq Studio is built with privacy at its core.

What makes Lynq privacy-friendly?

  • ✓ No personal data collected from visitors
  • ✓ IP addresses hashed with daily-rotating salt, never stored
  • ✓ First-party cookies only (no cross-site tracking)
  • ✓ No browser fingerprinting
  • ✓ EU-hosted infrastructure
  • ✓ Data ownership stays with the customer
  • ✓ GDPR, KVKK, CCPA compatible

Cookies Used

CookiePurposeDuration
_lynq_idAnonymous visitor identifier2 years
_lynq_attrCampaign attribution90 days

For full details, see our Privacy Policy, Terms of Service, and GDPR Compliance pages.

FAQ

Do I need a cookie consent banner?

In most cases, no. Lynq uses only first-party cookies for anonymous analytics, which can be processed under legitimate interest (GDPR Art. 6(1)(f)). However, consult your legal advisor for your specific jurisdiction.

How is this different from Google Analytics?

Lynq runs entirely on your domain (first-party). This means no data goes to Google, ad blockers don't interfere, cookies persist longer, and you see all visitors — not a sample. Works for websites, SaaS products, and mobile apps.

Can I use Lynq alongside GA4?

Yes. Many customers run both during a transition period. Lynq doesn't interfere with other tracking scripts.

Where is my data stored?

Analytics data is stored in ClickHouse on EU infrastructure. Account data is stored in PostgreSQL. All connections use TLS encryption.

Can I export my data?

Yes. Every report can be exported as CSV. You can also use the API to pull data programmatically in JSON format.

What happens if I exceed my plan's page view limit?

We'll notify you and suggest upgrading. We won't silently stop collecting data. There's always a grace period.

Does Lynq work with single-page applications?

Yes. The tracker automatically detects client-side navigation (pushState / replaceState) and tracks page views accordingly.

Can I track multiple websites or apps?

Yes. Each website or app gets its own project ID. You can switch between projects in the dashboard header. We support web, iOS, Android, and Flutter.

What's the data retention period?

Default is 2 years for analytics events. You can request shorter retention periods if needed.

How do I delete all my data?

Contact us at privacy@lynq.studio. We'll delete all your data within 30 days.

Need help?

Can't find what you're looking for?