The page event lets you record whenever a user sees 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

The page event collects several fields about the page:

FieldTypeDescription
nameStringThe name of the page
categoryStringThe category of the page
titleStringThe title of the page
urlStringThe full url of the page, with scheme, host, path, and search
pathStringThe path of the page
searchStringThe search query of the page
keywordsArrayThe keywords associated with the page
propertiesObjectFree-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 the page event for each page viewed, setting the values of the above fields from the HTTP request or DOM.

For React applications, once you have successfully installed the React-Edgee SDK, no further action is required. This library ensures seamless integration of Edgee’s services and accurate tracking of page views during SPA navigations.

2 - Manually

In some cases, manually triggering the page 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:

window.addEventListener('edgee:loaded', function(){
    edgee.page();
});

Context Payload

You can manually specify each field by writing what we called a JSON Context Payload in your page.

Here is an example of how to insert a Context Payload:

In this example, we’ve specified the name, category, title, and url fields for the page event. Edgee will use this information to enrich the data collected for each page view, providing a more detailed view of user interactions on your website.

To know more about the Context Payload capabilities, check the dedicated documentation.

Fields gathering

You know now that the best way to specify the page fields is by using the Context Payload. But here is a table that shows you how Edgee gathers the fields if you don’t specify them:

FieldTypeField definition order
nameStringcontext payload, or by the page’s title tag
categoryStringThis field is only defined by the context payload
titleStringcontext payload, or by the page’s title tag
urlStringcontext payload, or the canonical tag, or the http request
pathStringcontext payload, or the http request
searchStringcontext payload, or the http request
keywordsArraycontext payload, or the keywords meta tag
propertiesObjectFree-form dictionary of properties, only defined by the context payload

Feel free to choose the best way to specify the page event fields, but remember that the Context Payload is the most powerful way to do it.

Control the destinations of the events

If for some reason you don’t want to send the page event to all the destinations you’ve set up in your Edgee project, you can specify the destinations that will receive the event data in the Context Payload.

More about manual triggering

Edgee automatically collects page event when a page is called, but in some cases, you may need to manually trigger the page event.

If you call the edgee.page() method without any parameters, Edgee will use the fields gathering we’ve seen before. But to avoid having to change the Context Payload every time you manually call edgee.page(), you can specify the fields directly in the method, which will have the effect of overloading field gathering.

Here is an example of a complete edgee.page() call:

// Syntax: edgee.page(pageObj, destinations);
edgee.page({
    "name": "page-name",
    "category": "my-category",
    "title": "Hello world!",
    "url": "https://www.example.com/welcome.html",
    "path": "/welcome.html",
    "search": "?utm_source=google",
    "keywords": ["hello", "world"],
    "properties": {
        "section": "political"
    }
}, {
    "Google Analytics": true,
    "Amplitude": true,
    "Facebook Conversions API": false
});

The edgee.page() method expect two optionals parameters:

FieldTypeDescription
pageObjoptionalObject|StringA 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.
destinationsoptionalObjectSpecifies which analytics components should receive the event data. This allows for targeted data sending based on your configured components within the Edgee platform.

Privacy by Design

At Edgee, we prioritize user privacy and the protection of personal data. Our approach to handling page 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 processing page 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 all page 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 page events, 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.

Conclusion

With anonymization, we guarantee that default page 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 Context Payload 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 destinations parameter to fine-tune where your data is sent, optimizing for relevance and efficiency.