Single Page Tracking

Automatically append the AnyTrack click ID to your page URL to track form submissions when hidden fields are not supported. Includes setup instructions, prerequisites, and best practices.

Overview

Some form builders and embedded forms do not support injecting the AnyTrack click ID into hidden fields via the standard AnyTrack tracking tag, but they can read and collect tracking parameters from the landing page URL.

To address this, AnyTrack provides a custom JavaScript snippet that automatically appends the AnyTrack click ID to the current page URL when the page loads. This ensures that tracking is maintained even when hidden fields are not supported.


Prerequisites

Before you begin

  • You can edit your website or funnel
  • You have access to your AnyTrack account
  • Form builder that supports URL parameter reading

⚠️ Important: Recommended Form Tracking Method (When Supported)

Before using this URL-based approach, we strongly recommend using standard AnyTrack form tracking whenever your form builder supports it.

Standard setup:

  1. Add a hidden field to your form

  2. Set its default value to:

    --CLICK-ID--
  3. The AnyTrack tracking tag automatically substitutes this token with the real click ID at runtime

  4. The click ID is:

    • Sent to your CRM or backend with the form submission
    • Returned to AnyTrack for server-side conversion tracking and attribution

This method is more robust and should be preferred whenever hidden fields and default values are supported.

👉 Use the URL-based solution below only if hidden field injection is not possible.


When to Use the URL-Based Click ID Appending

Use this solution if:

  • Your form is hosted on your website
  • The form cannot read values from the AnyTrack tracking tag
  • The form can capture values from URL parameters

Typical examples include external form tools, embedded widgets, or legacy form builders with limited customization options. This method works perfectly with JotForm embeds.

Additional Use Cases

  • Third-Party Form Integrations: If you are using third-party form services that do not allow direct script injections but can read URL parameters, this method ensures tracking continuity.
  • Email Campaign Landing Pages: When directing traffic from email campaigns to landing pages, appending the click ID to the URL can help track conversions effectively.
  • A/B Testing Scenarios: In A/B testing environments where different forms are tested, using URL parameters ensures consistent tracking across variations.

How It Works

  1. The script waits until the AnyTrack library is fully loaded.
  2. It retrieves the AnyTrack click ID (atclid).
  3. It appends the click ID to the current page URL as a query parameter.
  4. The page URL is updated with no page reload.
👍

Note that all URL parameters present on the page remain.

Default URL Query Parameter

By default, the click ID is appended using the following parameter:

_atid

Example:

https://example.com/landing-page?_atid=ANYTRACK_CLICK_ID

Installation Instructions

  1. Copy the script below.
  2. Paste it into the <head> section of your website.
  3. Place it alongside your regular AnyTrack tracking tag.

The atclidToUrl Command

Add the atclidToUrl command in the head section of the page if you want it across all the pages, or in the body if you want it only on specific pages.

By default, the URL parameter will be set as ?_atid=9asd9f7asdf

<script>
AnyTrack(function() {
    AnyTrack('atclidToUrl');
});</script>

Customizing the URL Query Parameter

If your form expects a different URL parameter name, you can change it in the script.

<script>
AnyTrack(function() {
    AnyTrack('atclidToUrl', 'custom_query_parameter');
});
</script>

Replace custom_query_parameter with the parameter name required by your form provider.

For example, in Jotform you create a custom field and you should manually set the query parameter in the field. If the unique name is in the page URL, it will be picked up by Jotform.




Notes & Best Practices

  • This script does not reload the page.
  • The URL is updated safely using browser history APIs.
  • Compatible with hash-based URLs.
  • Designed for privacy-first, first-party tracking setups.
  • Use only when hidden field injection is not supported.
  • All URL parameters are preserved.

Result

Your form will be able to capture the AnyTrack click ID from the page URL and pass it to your backend or CRM, enabling accurate server-side conversion tracking and attribution.