form_submit
Enhanced measurementwebAutomatically triggered when the user submits a form Note: You can only use the parameters in your reports if you create custom dimensions for them.
- Platforms
- web
- When it fires
- Collected automatically; no code needed.
Parameters (4)
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| form_id | - | - | HTML id attribute of DOM element | - |
| form_name | - | - | HTML name attribute of DOM element | - |
| form_destination | - | - | Action attribute of DOM element (where form data is sent) | - |
| form_submit_text | - | - | Text of the submit button | - |
Example
gtag.js
gtag('event', 'form_submit', {
form_id: '...',
form_name: '...',
form_destination: '...',
form_submit_text: '...',
});GTM dataLayer
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'form_submit',
form_id: '...',
form_name: '...',
form_destination: '...',
form_submit_text: '...',
});