Events

Track any action on your site with a few lines of code. Your events go to Facebook, TikTok and GA4.

Custom events

Track anything visitors do, with a few lines of code

A custom event is any action you can detect on your page: a VSL watched to 50%, a button clicked, a checkout page reached. You paste a short snippet on your site and the event shows up in TrueMetriks and is sent to Facebook, TikTok and GA4 under the name you choose. Google Ads only takes the standard events, so custom events are not sent there.

Not a coder? Copy one of our AI prompts below into ChatGPT or Claude, describe what you want to track, and paste the code it gives you.

GoHighLevelClickFunnelsWordPressShopifyCustom websitesAny page with your tracker
Read the Events guide

How it works

1

Your tracker is already installed

The same TrueMetriks code you added during setup. Nothing new to install.

2

Paste a snippet below it

In the same place: GoHighLevel tracking code, ClickFunnels head code, your WordPress header, or your site's HTML.

3

Your event is live

It appears under Conversions in a few minutes and goes to every Facebook, TikTok and GA4 connection.

The one call that does it

<script>
/* TrueMetriks: send a custom event. Waits for the tracker, once per page. */
window.tmTrack = window.tmTrack || function (name, details) {
  var sent = (window._tmFiredEvents = window._tmFiredEvents || {});
  if (sent[name]) return;
  sent[name] = true;
  var tries = 0;
  (function send() {
    if (window.tmFireEvent) window.tmFireEvent(name, details);
    else if (window.Shopify && Shopify.analytics && Shopify.analytics.publish)
      Shopify.analytics.publish("tm_custom_event", { name: name, details: details || {} });
    else if (tries++ < 50) setTimeout(send, 200);
    else delete sent[name];
  })();
};
</script>

Every example below starts with this helper. It waits until your tracker has loaded and sends each event name once per page, so a reload loop or a busy scroll never floods your reports.

Things you can track

Click one to see the code and an AI prompt for it.

VSL watched %

25%, 50%, 75% and finished

Paste the whole block below your TrueMetriks tracking code
<script>
/* TrueMetriks: send a custom event. Waits for the tracker, once per page. */
window.tmTrack = window.tmTrack || function (name, details) {
  var sent = (window._tmFiredEvents = window._tmFiredEvents || {});
  if (sent[name]) return;
  sent[name] = true;
  var tries = 0;
  (function send() {
    if (window.tmFireEvent) window.tmFireEvent(name, details);
    else if (window.Shopify && Shopify.analytics && Shopify.analytics.publish)
      Shopify.analytics.publish("tm_custom_event", { name: name, details: details || {} });
    else if (tries++ < 50) setTimeout(send, 200);
    else delete sent[name];
  })();
};

/* Works for an HTML5 <video>. For YouTube, Vimeo or Wistia, use the AI prompt. */
var video = document.querySelector("video");
if (video) video.addEventListener("timeupdate", function () {
  if (!video.duration) return;
  var pct = video.currentTime / video.duration * 100;
  [25, 50, 75, 100].forEach(function (m) {
    if (pct >= m - 0.5) tmTrack("VideoWatched" + m);
  });
});
</script>

Where your events show up

TrueMetriks: Conversions - Custom eventsFacebook: custom event, same nameTikTok: custom event, same nameGA4: same name in lowercaseGoogle Ads

Google Ads is left out on purpose: it only counts the standard events (Lead, Purchase and so on) as conversions. You can switch your events off per pixel with the Your own events switch under Settings - Tracking.