Analytics

Metadata

In addition to tracking events on your website, you can add metadata to your page views. Metadata provides contextual information about a page at the time it is viewed, such as user status, page category, or any other relevant attribute. This information can help you better understand the context of user interactions and improve your data analysis.

Key Components

  1. Metadata:
    • Purpose: Metadata provides additional context about a page view.
    • Usage: Add relevant metadata to your page views to enhance the understanding of user interactions and the state of your pages.

Example Breakdown

Here's how you can implement metadata for a page view:

window.fullres ||= {events: [] };
window.fullres.metadata = { isLoggedIn: true };
  • Initialization:

    • The first line ensures window.fullres is defined. If you are also implementing events, this only needs to be done once.
  • Adding Metadata:

    • The second line sets the metadata object with the key-value pair { isLoggedIn: true }.

Practical Use

When you add metadata to a page view, you can capture various aspects of the page context. For example:

  1. User Status

    • Metadata: isLoggedIn
    • Value: true or false
    window.fullres.metadata = { isLoggedIn: true };
    
  2. Page Category

    • Metadata: pageCategory
    • Value: Descriptive category name
    window.fullres.metadata = { pageCategory: 'blog' };
    
  3. User Role

    • Metadata: userRole
    • Value: Role of the user (e.g., 'admin', 'editor', 'subscriber')
    window.fullres.metadata = { userRole: 'subscriber' };
    
  4. Content Tags

    • Metadata: contentTags
    • Value: Array of tags describing the content
    window.fullres.metadata = { contentTags: ['technology', 'innovation'] };
    

Combined Metadata Example

In this example, we will add multiple metadata attributes to a page view, including user status, page category, user role, and content tags.

window.fullres ||= { events: [] };
window.fullres.metadata = {
    isLoggedIn: true,
    pageCategory: 'blog',
    userRole: 'subscriber',
    contentTags: ['technology', 'innovation']
};

Summary

By adding metadata to your page views, you can provide rich contextual information that enhances your understanding of user behavior and page characteristics. Metadata helps in segmenting and filtering your data, making your analysis more insightful and actionable.

If you have any questions or need further customization, please let us know!

Limits

  • No more than 100 Metadata per page view or event
  • The Metadata key should be less than 125 characters
  • Each Metadata value should be less than 1000 characters

Personally Identifiable Information

Please do not pass Personally Identifiable Information through as a value.