page event lets you record whenever a user visits a page, along with any optional properties about the page.
Each time Edgee collects a page event, it sends the data to the analytics components you’ve previously set up in your Edgee project.
Event fields
Thepage event collects several fields about the page (all optional):
| Field | Type | Description |
|---|---|---|
name | String | The name of the page |
category | String | The category of the page |
title | String | The title of the page |
url | String | The full url of the page, with scheme, host, path, and search |
path | String | The path of the page |
search | String | The search query of the page |
referrer | String | The referrer of the page (full URL) |
keywords | Array | The keywords associated with the page |
properties | Object | Free-form dictionary of properties of the page |
How to collect the page event?
1 - Automatically
If you followed the Data Collection Highlights, you’ve already installed the Edgee SDK on your website. Once you’ve installed it, Edgee collects thepage event for each page viewed,
setting the values of the above fields from the HTTP request or DOM.
2 - Manually
In some cases, manually triggering thepage event is necessary to accurately collect user movements across different views.
Edgee’s SDK facilitates this through the edgee.page() method, allowing developers to send page events with custom data
whenever a user navigates to a new part of the application.
Here’s an example of how to manually trigger a page event:
edgee.page() method without any parameters, Edgee will use the fields gathering strategy described below.
But to keep the data collection under your control, you can specify the fields directly in the method.
Here is an example of a complete edgee.page() call:
edgee.page() method expect two optionals parameters:
| Field | Type | Description |
|---|---|---|
page_obj (optional) | Object|String | A dictionary object containing details of the page event. This object can include all the following optional fields: name, category, title, url, path, search, keywords, and properties. You can also provide a string that will be used as the name field. |
components (optional) | Object | Specifies which analytics components should receive the event data. This allows for targeted data sending based on your configured components within the Edgee platform. |
Fields gathering
In case you don’t specify the fields in theedgee.page() function, here’s how Edgee gathers the page information:
| Field | Type | How the value is determined |
|---|---|---|
name | String | Set by the edgee.page() function (if provided), otherwise taken from the page’s <title> tag. |
category | String | Only set if provided in the page_obj parameter of the edgee.page() function. |
title | String | Set from the page_obj parameter if provided, otherwise taken from the page’s <title> tag. |
url | String | Set by the edgee.page() function (if provided), or else from the <link rel="canonical"> tag, or finally from the HTTP request. |
path | String | Set from the page_obj parameter if provided, otherwise taken from the HTTP request. |
search | String | Set from the page_obj parameter if provided, otherwise from the HTTP request. |
keywords | Array | Set from the page_obj parameter if provided, otherwise from the <meta name="keywords"> tag. |
properties | Object | Only defined if provided in the page_obj parameter—used as a free-form dictionary of page properties. |
Control the components that will receive the events
If for some reason you don’t want to send thepage event to all the components you’ve set up in your Edgee project,
you can specify the components that will receive the event data in the components parameter of the edgee.page() function.
Privacy by design
At Edgee, we prioritize user privacy and the protection of personal data. Our approach to handlingpage event data is designed to
respect user privacy by default, ensuring data is anonymized and processed in compliance with stringent data protection standards.
Anonymization by default
When processingpage event data for analytics component, Edgee implements robust data anonymization techniques. These methods
are designed to remove or alter personally identifiable information (PII), rendering it impossible to trace the data back to any individual.
Through this process, data is stripped of identifying details, ensuring it cannot be used to track or identify users.
The Option for PII Transmission
While our standard practice involves anonymizing allpage event data, we recognize that certain analytics use cases
may require the transmission of PII. Edgee supports this capability, allowing developers to include PII in page events
if necessary. However, it’s crucial to understand the implications:
- User Consent is Paramount: Before sending any PII through Edgee, you must obtain explicit consent from the users whose data is being collected. This consent should be informed, meaning users are fully aware of what data is collected and how it will be used.
-
Responsibility of the Developer: If you choose to send PII with
pageevents, the responsibility for managing that data in compliance with applicable privacy laws rests with you, the Edgee customer. You must ensure that your data collection practices adhere to GDPR, CCPA, or any other relevant data protection regulations.
The need for consent
With anonymization, we guarantee that defaultpage data sent to your analytics components cannot be used to identify and track an individual.
Therefore, you don’t need to ask for consent before sending default page event data to Edgee, as no personal data is sent.
To know more about how we handle privacy, check the dedicated Privacy documentation.
Best Practices for page Events
- Rich Context: The Data Layer allows for the specification of comprehensive context data for each event, enhancing the granularity of analytics data captured. Don’t hesitate to provide as much information as possible about the page.
- Manual JS Compatibility: Edgee’s manual triggering capabilities ensure that you can collect pageviews without the traditional webpage reloads.
- Flexible Destination Configuration: Utilize the components parameter to fine-tune where your data is sent, optimizing for relevance and efficiency.