How Do I Use Gleam to Track Custom Actions With JavaScript?

Embed the Gleam script, then use gleam.track('your_action_name') on form submission or other behaviors. Expand this FAQ to see where and how to implement it properly.

To track a custom event using Gleam:

  • Add the Gleam embed script to your site
  • Create a Custom Action in your campaign
  • Trigger gleam.track('your_action_name') when the action completes

You can also pass optional metadata to track variations. This works with JavaScript forms, video completions, user onboarding flows, or anything not captured via a direct link.

Visit the API Tracking documentation to see sample code and setup instructions.

See Next Article

Can I Use Gleam API Tracking With a Headless CMS or SPA?

Yes—gleam.track() works with Single Page Applications and headless setups. Expand this FAQ to learn the best way to implement it with dynamic page states.