Skip to content
Sealmetrics

    ↑↓ to move · Enter to open · Esc to close

    Docs menu

    Implementation · Tracker

    Conversions

    Track purchases, leads, and signups with sealmetrics.conv(): syntax, monetary values, custom properties, and item arrays for eCommerce, cookie-free.

    Track purchases, leads, signups, and other goal completions with monetary value.

    Syntax

    javascript
    sealmetrics.conv(type, amount);
    sealmetrics.conv(type, amount, properties);
    ParameterTypeRequiredDescription
    typestringYesConversion name (e.g., 'purchase', 'lead', 'signup')
    amountnumberNoMonetary value. Omit or use 0 for non-monetary conversions
    propertiesobjectNoCustom key-value data

    Examples

    Purchase

    javascript
    sealmetrics.conv('purchase', 99.99);

    Purchase with Properties

    code
    sealmetrics.conv('purchase', 149.99, {
      currency: 'EUR',
      payment_method: 'credit_card',
      coupon: 'SAVE10',
      items: [
        { product_name: 'Camiseta', price: 19.95, quantity: 2, category: 'Ropa' },
        { product_name: 'Pantalón', price: 49.99, quantity: 1, category: 'Ropa' }
      ]
    });

    Lead (No Monetary Value)

    javascript
    sealmetrics.conv('lead', 0, {
      form_name: 'contact_form',
      source: 'homepage'
    });

    Signup

    javascript
    sealmetrics.conv('signup', 0, {
      plan: 'trial',
      referral_code: 'FRIEND20'
    });

    Subscription Purchase

    javascript
    sealmetrics.conv('purchase', 49, {
      plan: 'pro_monthly',
      currency: 'USD',
      billing_cycle: 'monthly'
    });

    eCommerce Implementation

    Thank You Page

    Place on your order confirmation page:

    html
    <script src="https://t.sealmetrics.com/t.js?id=YOUR_ACCOUNT_ID&group=checkout" defer></script>
    <script>
      // Wait for tracker to load
      window.addEventListener('load', function() {
        sealmetrics.conv('purchase', 189.99, {
          currency: 'EUR',
          payment_method: 'credit_card',
          items: [
            { product_name: 'Widget Pro', product_id: 'WDG-001', price: 59.99, quantity: 2, category: 'Widgets' },
            { product_name: 'Widget Case', product_id: 'WDG-CASE', price: 70.01, quantity: 1, category: 'Accessories' }
          ]
        });
      });
    </script>

    Dynamic Values (Server-Side Rendering)

    html
    <script src="https://t.sealmetrics.com/t.js?id=YOUR_ACCOUNT_ID&group=checkout" defer></script>
    <script>
      window.addEventListener('load', function() {
        sealmetrics.conv('purchase', <?php echo $order->total; ?>, {
          currency: '<?php echo $order->currency; ?>'
        });
      });
    </script>

    WooCommerce

    In functions.php or a custom plugin:

    php
    add_action('woocommerce_thankyou', function($order_id) {
      $order = wc_get_order($order_id);
      $items = array();
      foreach ($order->get_items() as $item) {
        $product = $item->get_product();
        $items[] = array(
          'product_name' => $item->get_name(),
          'product_id'   => $product ? $product->get_id() : '',
          'sku'          => $product ? $product->get_sku() : '',
          'price'        => $item->get_total() / max($item->get_quantity(), 1),
          'quantity'     => $item->get_quantity(),
        );
      }
      ?>
      <script>
        window.addEventListener('load', function() {
          sealmetrics.conv('purchase', <?php echo $order->get_total(); ?>, {
            currency: '<?php echo $order->get_currency(); ?>',
            payment_method: '<?php echo $order->get_payment_method(); ?>',
            items: <?php echo json_encode($items); ?>
          });
        });
      </script>
      <?php
    });

    Shopify

    In your checkout.liquid or via Shopify Additional Scripts:

    html
    <script>
      window.addEventListener('load', function() {
        sealmetrics.conv('purchase', {{ checkout.total_price | money_without_currency | remove: ',' }}, {
          currency: '{{ checkout.currency }}',
          items: [
            {% for item in checkout.line_items %}
            {
              product_name: '{{ item.title | escape }}',
              product_id: '{{ item.product_id }}',
              sku: '{{ item.sku | escape }}',
              price: {{ item.final_price | money_without_currency | remove: ',' }},
              quantity: {{ item.quantity }}
            }{% unless forloop.last %},{% endunless %}
            {% endfor %}
          ]
        });
      });
    </script>

    SaaS Implementation

    Free Trial Signup

    javascript
    document.querySelector('#signup-form').addEventListener('submit', function(e) {
      sealmetrics.conv('signup', 0, {
        plan: 'trial',
        source: 'pricing_page'
      });
    });
    javascript
    // After successful payment
    sealmetrics.conv('purchase', 49, {
      plan: 'pro',
      billing_cycle: 'monthly',
      currency: 'USD'
    });

    Plan Upgrade

    javascript
    sealmetrics.conv('upgrade', 99, {
      from_plan: 'starter',
      to_plan: 'pro',
      currency: 'USD'
    });

    Properties Reference

    Common properties to include:

    PropertyTypeDescriptionExample
    currencystringISO 4217 currency code'EUR', 'USD', 'GBP'
    payment_methodstringPayment type'credit_card', 'paypal'
    couponstringDiscount code used'SAVE10'
    itemsarrayArray of product objectsSee below
    planstringSubscription plan name'pro', 'enterprise'
    billing_cyclestringBilling frequency'monthly', 'yearly'

    Product Items

    For eCommerce purchases, use the items property to send an array of product objects. Each object supports free-form key-value fields:

    javascript
    sealmetrics.conv('purchase', 89.99, {
      currency: 'EUR',
      items: [
        { product_name: 'Camiseta', price: 19.95, quantity: 2, category: 'Ropa' },
        { product_name: 'Pantalón', price: 49.99, quantity: 1, category: 'Ropa' }
      ]
    });

    Common fields per item: product_name, product_id, sku, price, quantity, category, brand, variant. You can add any custom fields you need — all fields are accepted.

    Timing

    Conversions Are Their Own Event Type

    A conversion is not counted as a pageview. The server classifies each hit by its payload: a hit carrying a conversion type (e) is recorded as a conversion (or a microconversion when the micro flag is set), and only hits without those fields are counted as pageviews.

    The initial pageview is already tracked automatically when the tracker loads (unless you use ?auto=0), so on a thank-you page you typically get one automatic pageview plus the conversion you fire — they are two separate events. You do not need to call sealmetrics() yourself just to "register" the conversion.

    Wait for Tracker to Load

    If calling conversion immediately on page load, wait for the script:

    javascript
    window.addEventListener('load', function() {
      sealmetrics.conv('purchase', 99.99);
    });

    Or check if function exists:

    javascript
    if (typeof sealmetrics !== 'undefined') {
      sealmetrics.conv('purchase', 99.99);
    }

    Deduplication

    Sealmetrics does not deduplicate conversions automatically. To prevent duplicate tracking:

    1. Server-side flag: Mark orders as "tracked" in your database
    2. One-time page: Redirect after conversion so refreshing doesn't re-trigger
    3. Session check: Use your own session logic to track if conversion was already sent

    Example: render the conversion call only once per order ID, from your order system:

    php
    // PHP example
    if (!$order->isTracked()) {
      echo '<script>sealmetrics.conv("purchase", ' . $order->getTotal() . ');</script>';
      $order->markAsTracked();
    }