Automatic events
The SDK sends these events itself. Refer to Script tag to stop or start each one.
| Event | When | Default |
|---|---|---|
page.viewed | The page loads, and each route change in a single page app | On |
form.submitted | A visitor submits a form | On |
link.clicked | A visitor clicks a link to a different site | On |
file.downloaded | A visitor clicks a link to a file | On |
element.clicked | A visitor clicks an element that is not a link to a different site or to a file | On |
scroll.reached | The visitor scrolls to 25, 50, 75 and 100 percent of the page | On |
The event value of a dataLayer push | Your site or GTM pushes an object with an event key | On |
{vendor}.{action} | An adapter receives an event from a vendor tool | On. Refer to Adapters. |
Properties
page.viewed
| Property | Description |
|---|---|
url | The full address of the page |
path | The path of the page |
title | The title of the page |
referrer | The address of the previous page |
form.submitted
| Property | Description |
|---|---|
formId | The id of the form |
formName | The name of the form |
action | The action address of the form |
page | The address of the page |
_detected | The field of each identifier that the SDK found, for example { "email": "work_email" } |
company | The name of the company |
title | The job title of the person |
country | The country |
firstName | The first name of the person |
lastName | The last name of the person |
companySize | The number of employees of the company |
The SDK finds the identifier fields from the autocomplete value, the input type, the name, the id, the label and the placeholder, in this order. It knows the words in English and in the Nordic and EU languages. It accepts a value only when the value is valid, for example an organization number with a correct check digit. The key of _detected is the identifier name and the value is the field name.
The SDK reads the value of a field only after the visitor grants the analytics purpose. Before that, the event has the form data and an empty _detected. The SDK sends identifiers only after consent.
| Field | The SDK sends it as |
|---|---|
| Email, phone, a profile on LinkedIn, X, Instagram, GitHub, TikTok or YouTube | An identify call |
| Company website, organization number, VAT number, LinkedIn company | An account call |
| Company name, job title, country, first name, last name, company size | Properties of form.submitted |
| All other fields | Nothing. Add a field with data-lg-capture. |
The SDK never sends a textarea, a password field, a one-time code field, a payment field, a hidden field or a personal identity number.
link.clicked
| Property | Description |
|---|---|
element.href | The link address |
element.text | The text of the link |
file.downloaded
| Property | Description |
|---|---|
element.href | The file address |
element.text | The text of the link |
extension | The file extension, for example pdf |
element.clicked
The event has the property element, with the same keys as in Data attributes:
| Property | Description |
|---|---|
element.tag | The tag name |
element.text | The first 100 characters of the text |
element.href | The link address, if the element has one |
element.id | The id of the element, if it has one |
sample | The part of the sessions that send this event, for example 0.1 |
Only a sample of the sessions sends element.clicked. The SDK selects 10% of the sessions by default. Set a different part with data-sample-clicks. To get the real number of clicks, divide a count by the value of sample. A rule that counts element.clicked sees only the sample.
Position of a click
link.clicked, file.downloaded and element.clicked also have these properties. A heatmap uses them.
| Property | Description |
|---|---|
element.selector | A CSS path to the element, from the nearest ancestor with an id. It has no class names. |
element.x, element.y | The point of the click in the element, from 0 to 1 |
point.x, point.y | The point of the click in the page, in CSS pixels |
viewport.width, viewport.height | The size of the browser window, in CSS pixels |
document.width, document.height | The size of the page, in CSS pixels |
Clicks
One click sends one automatic event only:
| Click | Event |
|---|---|
| A link to a file | file.downloaded |
| A link to a different site | link.clicked |
| All other elements | element.clicked |
scroll.reached
| Property | Description |
|---|---|
percent | 25, 50, 75 or 100 |
GTM dataLayer
Each dataLayer push with an event key becomes an event with the same name in lowercase. The other keys of the push become properties.
dataLayer.push({ event: 'generate_lead', form: 'contact', value: 1 });The SDK sends generate_lead with the properties form and value. It ignores the GTM events gtm.js, gtm.dom and gtm.load, and each key that starts with gtm..
The options datalayerInclude and datalayerExclude select the event names. An entry with a configured email key or user ID key sends an identify when the site grants analytics. Refer to Use the dataLayer.
Data on each event
Each event has these values:
| Value | Description |
|---|---|
context.page | The address, the referrer and the title of the page |
| UTM values | The five utm_ values from the first page of the session |
clickIds | The ad click IDs from the first page of the session, for example gclid. Only after consent for analytics and ads. |
| Identifiers | The visitor ID after consent, and the identifiers from identify |