Getting Started

Custom Goals

Track specific user actions beyond pageviews

Flowsery Analytics lets you monitor specific user actions beyond pageviews, referred to as Goals (signup, newsletter subscribe, checkout initiated, etc.).

  • Gain visibility into what visitors do on your site
  • Unlock the Journey feature
  • Enhance revenue predictions and conversion funnels

You can track goals using three methods:

Method #1: Client-side tracking with JavaScript

Call the flowsery() function and pass your goal name as the argument. Place the JavaScript snippet wherever the conversion happens (e.g., on a "thank you" page after signup, when a user clicks a button, etc.).

window?.flowsery("signup");

Rules for goal_name:

  • Use lowercase letters
  • Numbers, underscores (_), and hyphens (-) are allowed
  • Maximum 64 characters

Advanced usage with custom parameters

Attach an object with custom parameters to your goals for richer analytics in Journey:

Goal with custom parameters
window?.flowsery("initiate_checkout", {
  name: "Elon Musk",
  email: "elon@x.com",
  product_id: "prod_123",
});

Rules for custom parameters:

  • Property names: lowercase letters, numbers, underscores (_), and hyphens (-) only. Max 64 characters.
  • Property values: any string, max 255 characters.
  • Maximum 10 custom parameters per event.

Ensure reliable tracking (recommended)

Add this snippet to your HTML <head> to guarantee events are captured even if they fire before the main script has loaded:

Event queue snippet
<script id="flowsery-queue">
  window.flowsery = window.flowsery || function() {
    window.flowsery.q = window.flowsery.q || [];
    window.flowsery.q.push(arguments);
  };
</script>

Method #2: Client-side tracking with HTML data attributes

Track goals automatically when users click any element with the data-fs-goal attribute. This is the simplest approach for tracking button clicks.

<button data-fs-goal="initiate_checkout">Buy Now</button>

In this example, Flowsery Analytics sends a goal named initiate_checkout.

Advanced usage with custom parameters

Add additional data-fs-goal-* attributes to include custom parameters:

Data attribute goal with parameters
<button
  data-fs-goal="initiate_checkout"
  data-fs-goal-price="49"
  data-fs-goal-currency="USD"
  data-fs-goal-plan-type="pro">
    Subscribe to Pro Plan
</button>

In this example, Flowsery Analytics sends a goal named initiate_checkout with { price: '49', currency: 'USD', plan_type: 'pro' } as custom parameters.

Rules for data attribute values:

  • Goal names: same rules as the JavaScript method (lowercase letters, numbers, underscores, hyphens, max 64 characters)
  • Parameter names: derived from the attribute name and converted from kebab-case to snake_case (e.g., data-fs-goal-product-id becomes product_id)
  • Parameter values: any string, max 255 characters (automatically sanitized)
  • Maximum 10 custom parameters per event

Client-side tracking limitations

While straightforward to implement, client-side tracking can be less accurate due to ad blockers or network issues. For greater reliability, consider server-side tracking.

Method #3: Server-side tracking (most accurate)

Track goals by sending data directly from your server via the Flowsery Analytics API. This is the recommended approach for maximum accuracy.

  • Get an API Key: Go to your Website Settings > API tab and generate an API key to authenticate your requests.
  • Send Goal data: Use the Goal API endpoint to submit goal information from your backend whenever a user completes the desired action.

Revenue tracking

To track revenue specifically (e.g., completed purchases), use the dedicated revenue attribution setup rather than custom goals for payments. This provides more granular financial analytics through Stripe, LemonSqueezy, or Polar integration.

Viewing custom parameters in your dashboard

When you pass custom parameters to a goal (using any of the methods above), they are visible directly in your dashboard.

  • Navigate to your analytics dashboard
  • Hover over any goal in the Goals card
  • Click the parameters icon to expand the breakdown

You will see a breakdown of each parameter value and how many visitors matched it. For example, if you track an initiate_checkout goal with a plan parameter, you can see how many visitors checked out on each plan (starter, pro, premium, etc.).

This works with any custom parameter you send β€” user emails, product names, plan types, currencies, or anything else you choose to track.

Billing

Usage-based billing

Custom goals count toward your Flowsery Analytics monthly usage. Be sure to track only what is necessary. You can review your usage in your Flowsery Analytics billing settings.