Using the Tracking Function

The LinkBridge tracker provides a lightweight JavaScript function you can call from your website to record events, goals, and custom parameters. Once the script is installed, the global function LinkBridge.sendEvent() is available for you to use anywhere on your pages.

1. Track events with parameters

Use the LinkBridge.sendEvent() function to send structured data about user interactions. Each call includes an event name and an optional parameters object.


// Event with parameters
LinkBridge.sendEvent('event', {
  revenue: 49.99,
  currency: 'USD',
  productId: 'sku_123',
});
  • 'event' → tells the tracker this is a event name start with custom_ for special events e.g. custom_login_form.
  • Parameters (optional) → provide extra details such as revenue, product, or context.
Dashboard showing events with revenue parameter (placeholder)
Screenshot suggestion: Dashboard with events and parameter values.

Event Types

  • Custom Events:Use the prefix custom_ followed by your event name.
    LinkBridge.sendEvent('custom_button_click', { label: 'Sign Up CTA' });
  • Sales Events:Sales events must be sent from your server for accuracy. Use the prefix win_and provide the required fields in the data object:
    LinkBridge.sendEvent('win_purchase', {
      saleAmount: 100,
      saleId: '123456',
      saleCurrency: 'USD'
    });

    ⚠️ Required fields: saleAmount, saleId, saleCurrency

Best Practices

  • Always prefix your event names with custom_ or win_.
  • Send sales events from your server to prevent data manipulation.
  • Keep event names lowercase and use underscores for readability.

2. Track page views

Page views are automatically tracked when the script loads, but you can also trigger them manually if you have a single-page application (SPA) or want to control when they fire.

// Manually track a page view
LinkBridge.sendEvent('pageView');
Dashboard showing tracked page views (placeholder)
Screenshot suggestion: Dashboard with recorded page views.

3. Track custom goals

Custom goals can be defined directly in your script using the LinkBridge.sendEvent() function, or through the dashboard. For example, you might want to track newsletter subscriptions or clicks on a checkout button.

// Track a newsletter signup goal
LinkBridge.sendEvent('custom_newsletter_signup', data);
Dashboard showing a custom goal event (placeholder)
Screenshot suggestion: Dashboard with custom goal event logged.

Copyright © 2025 - All rights reserved