Skip to content

Custom HTML Integration

The Custom HTML integration is a lightweight tracking snippet — like a Google Analytics or Facebook Pixel tag — for storefronts that aren't on Shopify. You paste one snippet into your site, and InfluTrace credits each sale to the right creator.

Use it when your store runs on a custom stack, a headless setup, or any platform without a dedicated connector yet. It's also the same engine behind the Wix and Magento integrations — those differ only in where you paste the snippet.

How it works

  1. You connect a Custom HTML integration and get a small snippet keyed to a public integration id (just like a GA measurement id).
  2. The snippet persists creator attribution (the ref/itc your tracking links carry) in the visitor's browser.
  3. Orders reach InfluTrace one of two ways:
    • Automatically, if your store already sends purchases to Google Analytics / GTM (see below), or
    • by a one-line influtrace('order', …) call on your confirmation page.

Clicks still come from your InfluTrace tracking links — the snippet only handles order attribution, so nothing is double-counted.

Connecting your store

  1. Open Integrations in the sidebar and click Add integration.
  2. Choose Custom HTML from the library.
  3. Enter your website URL (e.g. https://shop.example.com). Orders are only accepted from this exact origin, so enter the address your store is actually served from.
  4. Click Get snippet — you'll get the embed code to install.

The integration appears on the Integrations page as Pending until you install the snippet and verify it.

Admins only

Connecting, verifying, and disconnecting integrations require an Admin role. Members can see connected stores but can't change them. See Roles & Permissions.

Installing the snippet

Paste the snippet into your site's <head>, on every page, then publish:

html
<!-- Influtrace -->
<script>
  (function(w,d,s,u,i){w.influtrace=w.influtrace||function(){(w.influtrace.q=w.influtrace.q||[]).push(arguments)};w.influtrace.id=i;var f=d.getElementsByTagName(s)[0],j=d.createElement(s);j.async=1;j.src=u;f.parentNode.insertBefore(j,f);})(window,document,'script','https://app.influtrace.link/api/v1/integrations/custom/t.js','YOUR_INTEGRATION_ID');
</script>

Your real snippet (with your integration id filled in) is shown in the connect dialog and again on the integration card under Set up — use that copy rather than the example above.

Automatic capture from Google Analytics / GTM

If your store already pushes purchases to a Google Analytics 4 or GTM dataLayer (common on Magento and many custom stacks), you're done after installing the snippet — no order code required. The snippet listens for the standard ecommerce events and reports them for you:

  • a purchase event → an order (reads transaction_id, value, currency, coupon; both GA4 and the older Universal Analytics shapes are supported), and
  • an add_to_cart event → an add-to-cart.

Orders are de-duplicated by their transaction id, so a purchase captured this way is never double-counted with a manual call.

Reporting orders manually

No Google Analytics? On your order confirmation / thank-you page, tell InfluTrace about the sale:

html
<script>
  influtrace('order', {
    orderId: 'ORDER-1234',   // your unique order id
    value: 79.00,            // order total
    currency: 'USD',
    coupon: 'CREATOR10'      // discount code used, if any
  });
</script>

You can also report add-to-cart from your product or cart page:

html
<script>
  influtrace('addToCart', {
    cartToken: 'CART-1234',  // any stable id for the cart
    value: 79.00,
    currency: 'USD'
  });
</script>

The snippet automatically attaches the creator attribution it saved earlier, so you only need to pass the event details.

Prefer server-rendered HTML? Set a global object instead and the snippet picks it up on load:

html
<script>
  window.influtraceOrder = { orderId: 'ORDER-1234', value: 79.00, currency: 'USD', coupon: 'CREATOR10' };
</script>

Coupons are the most reliable signal

If the order carries a creator's discount code in coupon, it's attributed by coupon even when the shopper's link attribution has expired. See Coupon Attribution.

Verifying the snippet

Once the snippet is live, open your website (so it loads), then on the integration card click Verify. InfluTrace confirms it has received a signal from your registered origin and flips the integration to Connected.

If you see "No pixel activity yet", the snippet hasn't reported in. Double-check that:

  • the snippet is on the page and the site is published, and
  • the page is served from the exact URL you registered (for example https:// vs http://, or www. vs the bare domain).

Connecting a store doesn't, by itself, track orders. On each link or coupon you want to measure, tick the store under Enable integrations.

Orders and revenue are recorded only for links and coupons with an integration enabled. Links with none still track clicks.

See Tracking Links and Coupon Attribution.

Security

The integration id is public (like any analytics pixel id). Order ingestion is guarded two ways:

  • Origin check — orders are accepted only from the website URL you registered.
  • Verify gate — orders are credited only after the integration is verified and Connected.

Because the snippet runs in the browser, treat it like any client-side analytics tag: it's best for capturing real customer orders, not as a tamper-proof source of truth.

Disconnecting

Click Disconnect on the store's card (admins only) to stop accepting its orders. Past orders stay in your reports. To turn it back on, add the integration again and re-verify.

Troubleshooting missing orders

  1. Is the integration enabled on the link or coupon? Without it, only clicks are recorded.
  2. Is the integration Connected? Orders sent before you verify are ignored — verify first.
  3. Is the order beacon firing from the registered origin? A mismatched origin (or a missing influtrace('order', …) call / dataLayer purchase event) means no order is recorded.
  4. Was the order attributable? An order with no coupon and no saved link attribution can't be credited to a creator and is skipped.

For how a synced order is matched to a creator, see How Attribution Works.

InfluTrace — creator attribution infrastructure