# Tracking Sign-Up Form Conversions

{% hint style="warning" %}
**Advanced feature** — implementing this requires technical knowledge.
{% endhint %}

If you run ads on Google or Facebook, you know how important it is to target the right audience. Both platforms let you optimise your target groups by tracking which ads actually led to a purchase of your service — Google provides a *Tracking Tag* for this and Facebook provides *FB Pixel*.

The ActiveNow sign-up form supports conversion tracking with both tools. We strongly encourage using them, as they can reduce ad spend while increasing new sign-ups.

## What events does the form send?

The ActiveNow form uses `window.postMessage()` to send information about actions taken within the form. The function is called with a name that describes what happened:

* `activenowDetailsLoaded` — sent after the client selects the classes they are interested in. Equivalent to *Add to cart* in eCommerce (e.g. Facebook – Add to cart).
* `activenowFormSubmitted` — sent after all required fields are filled in and the sign-up is submitted. Equivalent to placing an order in eCommerce (e.g. Facebook – Submit application).

## Receiving form events

To receive the events sent by the form, use `window.addEventListener("message")` and check the type of message received. Example JavaScript:

```javascript
window.addEventListener("message", messageReceived, false);

function messageReceived(e)
{
    if ( e.data == 'activenowDetailsLoaded' ) {
        // Call the relevant Facebook or Google event here
    }
    if ( e.data == 'activenowFormSubmitted' ) {
        // Call the relevant Facebook or Google event here
    }
}
```

## Sending events to Google / Facebook

In the places marked *Call the relevant Facebook or Google event here*, insert the appropriate *Tracking Tag* or *FB Pixel* code. For more information:

* Facebook – <https://developers.facebook.com/docs/facebook-pixel/advanced/#buttonclicks>
* Google – <https://support.google.com/google-ads/answer/6331304?hl=en>

The ActiveNow team is not able to assist with the technical implementation of this feature on your website.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.activenow.io/en/online-sign-ups/tracking-signup-form-conversions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
