Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Webform JavaScript Setting

No security coverage Under active development 8 sites

Part of the Webform ecosystem · 217 projects

This module allows you to capture JavaScript settings or properties from your web page and include them in your webform submissions. It can pull information like the user's browser type or Google Analytics Client ID to enrich your form data.

The Webform JavaScript Setting module provides a hidden Webform element that captures a value from a JavaScript property or method and includes it with the submission. The module can capture properties from window.navigator, drupalSettings, JavaScript-based tracking software, and browser cookies.

Use cases

The module can be used to capture information such as:

  • A Google Analytics client ID, allowing Webform submissions to be correlated with Analytics sessions.
  • The browser user agent, such as Chrome or Firefox.
  • An identifier or other value stored in a browser cookie available to JavaScript.

Configuration

  1. Go to the Webform configuration page and open the third-party settings.
  2. Add each JavaScript setting with a machine name, JavaScript declaration, and label.
  3. Add a JavaScript Setting element to a webform and select the declaration to capture.

Supported declarations

JavaScript properties can be entered using dot notation. Methods without arguments are also supported.

Examples include:

  • navigator.userAgent captures the browser's user agent.
  • drupalSettings.user.uid captures the current Drupal user ID.
  • WebformJavaScriptSettingTest.get calls the get() method and captures its return value.
  • document.cookie captures the complete cookie string available to JavaScript.
  • document.cookie.[name] captures the raw value of the named cookie. For example, document.cookie.analytics_id captures the value of the analytics_id cookie.

Cookies that are unavailable to JavaScript, including cookies marked HttpOnly, cannot be captured.

Ask your assistant about Webform JavaScript Setting

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
7
Tracked since
Apr 2023
Latest release
1 month ago
Releases (12 mo)
1
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
1.0.0-alpha6 Pre-release 9–11 Sep 10, 2026
1.0.0-alpha5 Pre-release 9–11 Feb 26, 2025
1.0.0-alpha4 Pre-release 9–10 Oct 11, 2023
1.0.0-alpha3 Pre-release 9 Jun 15, 2023
1.0.0-alpha2 Pre-release 9 May 16, 2023
1.0.0-alpha1 Pre-release 9 Apr 12, 2023
1.0.x-dev Dev 9–11 Apr 12, 2023