Append Click ID to URL
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
Section titled “Overview”Attribution breaks when your form can’t collect the Click ID. Without that identifier, the CRM lead never connects back to the Facebook ad that generated it. Facebook stops optimizing your campaigns and your cost per lead climbs.
Some form builders (like Jotform embeds, external widgets, or legacy tools) don’t support hidden field injection. They can’t read values from the Tracking Tag, but they can collect URL parameters. This custom JavaScript snippet automatically appends the AnyTrack Click ID to your page URL, ensuring forms collect the tracking parameter and your attribution stays intact.

Prerequisites
Section titled “Prerequisites”Recommended Form Tracking Method (When Supported)
Section titled “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:
-
Add a hidden field to your form.
-
Set its default value to:
--CLICK-ID-- -
The Tracking Tag automatically substitutes this token with the real click ID at runtime.
-
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 reliable and should be preferred whenever hidden fields and default values are supported.
When to Use the URL-Based Click ID Appending
Section titled “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 Tracking Tag
- The form can collect values from URL parameters
Typical examples include external form tools, embedded widgets, or legacy form builders with limited customization options. This method works well with Jotform embeds.
Additional Use Cases
Section titled “Additional Use Cases”- JavaScript Form Widgets: If the form is a JavaScript widget that the Tracking Tag cannot interact with, the Tracking Tag cannot fill a hidden field in the widget. The widget can still collect the
_atidparameter from the page URL. - Forms That Load After the Page: The Tracking Tag substitutes the
--CLICK-ID--placeholder when the page loads. If the form appears later (a popup or a quiz result step), the Tracking Tag never substitutes the placeholder. The form can still collect the Click ID from the URL parameter. - Links Inside Iframes: If a link that needs autotagging is inside an iframe, the Tracking Tag cannot modify the link. Scripts inside the iframe can read the URL, including the
_atidparameter, and collect or store the Click ID. - 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
Section titled “How It Works”- The script waits until the AnyTrack library is fully loaded.
- It retrieves the AnyTrack click ID (
atclid). - It appends the click ID to the current page URL as a query parameter.
- The page URL is updated with no page reload.
Default URL Query Parameter
Section titled “Default URL Query Parameter”By default, the click ID is appended using the following parameter:
_atidExample:
https://example.com/landing-page?_atid=ANYTRACK_CLICK_IDInstallation Instructions
Section titled “Installation Instructions”- Copy the
atclidToUrlscript in the section below. - Paste it into the
<head>section of your website. - Place it alongside your regular Tracking Tag — see Install AnyTrack Tag for the base install.
The atclidToUrl Command
Section titled “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
Section titled “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.
Some form builders reject field names that start with an underscore. If your form builder rejects _atid, set a custom parameter name such as click_id, and map the form field to that name.
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 and Best Practices
Section titled “Notes and 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.
- This method is not specific to single page applications, but it also works in them.
Once configured, your form collects the AnyTrack Click ID from the page URL and passes it to your backend or CRM, enabling accurate server-side conversion tracking and attribution.
Related Resources
Section titled “Related Resources”FAQ & Troubleshooting
FAQ was last reviewed on 2026-08-17
Does the URL-based method work with all form builders?
Will the URL change cause a page reload?
Should I use hidden fields or URL parameters?
Can I turn off the _atid parameter on Shopify, Systeme.io or GoHighLevel?
_atid to the page URL automatically so the platform stores the Click ID with its own data. There is no setting that disables it. The parameter is expected, and it is unrelated to Cross-Domain Tracking. See AnyTrack Identifiers.Can I use atclidToUrl to rename the _atid parameter?
atclidToUrl command adds the Click ID to the page URL — it does not rename a parameter that is already there. On Shopify, Systeme.io and GoHighLevel you do not need this script at all, because AnyTrack appends the parameter automatically. Adding it on those platforms gives you a second Click ID parameter under the new name, next to the automatic _atid. Change the parameter name only when you install the script yourself on a platform where AnyTrack does not append it, and your form provider requires a different name.A third-party app on my site breaks when _atid is in the URL. What do I do?
atclidToUrl script to work around it — on a platform where the parameter is added automatically, the script cannot remove or rename it. Contact support with the name of the app, what it does when the parameter is present (wrong page, redirect loop, error), and one URL where it fails. Most apps ignore query parameters they do not recognize, so a failure is worth investigating rather than working around.