AI agents: the content index is at /llms.txt. Every page is also available as Markdown — send the request header Accept: text/markdown, or append .md to the page URL.
Xperience Docs

Cookie consent

We use necessary cookies (opens in a new tab) to run our website and improve your experience while browsing. Additional cookies are only used with your consent. You may revoke your consent on the Cookies Policy (opens in a new tab) page or in your browser at any time.

Configure (opens in a new tab)
  • Documentation
    Administration interface basicsDevelopers and adminsBusiness usersChangelogGlossary
  • Guides
    Welcome to Xperience by KenticoAdministration interface basicsCustomer journeysDigital marketingConfigurationDevelopmentArchitectureUpgrade to Xperience by Kentico
  • Training
    For AdminsFor Business usersFor DevelopersFor Solution architects
  • API Examples
    ConfigurationContent managementDevelopmentDigital marketing
  • Changelog
    Documentation updatesSecurity advisories

Activities and contacts

  • Introduction to activities and contacts
  • Enable activity tracking
  • Define custom activities in Xperience
  • Log custom activities from the client side
  • Log custom activities from the server side
  • Hide builder content from visitors who have not consented to tracking
  • Implement cross-site activities
  • Add a custom field to the Contact profile
  • Learn more about contacts and activities

Module: Activities and contacts

3 of 9 Pages

Define custom activities in Xperience

You may encounter use cases where you need to track visitor actions not covered by out-of-box options, or where you need to track additional details. Xperience allows you to define custom activities, which can then be logged through both client-side and server-side code.

Let's dive into the process of logging a custom activity when a visitor downloads a file using JavaScript, and logging a custom activity when a user clicks a like button using C#.

Create custom activity types

The first step to logging custom activities is to create the activity types that represent them.

In the Xperience administration interface, navigate to the Activity types tab of the Contact management application and define activity types with the following values.

  • Activity 1:
    • Display name: File Download
    • Code name: filedownload
    • Description: The visitor downloaded a file.
    • Enabled: True
  • Activity 2:
    • Display name: Page like
    • Code name: pagelike
    • Description: The visitor clicked a like button on a page.
    • Enabled: True

Let's explore two different approaches for logging custom activities, using one for each of the types we just defined.

← Previous page

3 of 9

Mark complete and continue →
  • Community Questions & Answers (opens in a new tab)
  • Contact support (opens in a new tab)