---
title: Introduction to activities and contacts
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

This module takes a detailed look at contacts and their activities in Xperience by Kentico, exploring practical examples.

We'll explore each of the following processes:

- Enabling activity tracking
- Conditionally rendering tracking scripts based on consent
- Logging custom activities, both from the server side and the client side
- Conditionally hiding the contents of page builder sections based on consent
- Logging activities from an external site
- Adding custom fields to the Contact object

> **Note:** Some of the materials in this module are not exclusive, and may look familiar if you've already completed other modules.

### Prerequisites

This module's hands-on materials require the following:

- Familiarity with [C#](https://learn.microsoft.com/en-us/dotnet/csharp/), [.NET Core](https://learn.microsoft.com/en-us/dotnet/), [Dependency injection](https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection), and the [MVC pattern](https://learn.microsoft.com/en-us/aspnet/core/mvc/overview).
- Basic experience using [Page Builder sections](https://docs.kentico.com/documentation/developers-and-admins/development/builders/page-builder/sections-for-page-builder.md).
- Familiarity with the concepts of [consents](https://docs.kentico.com/documentation/developers-and-admins/data-protection/consent-management.md) and [data protection](https://docs.kentico.com/documentation/developers-and-admins/data-protection.md).
  - Some of the samples require that you have completed the [Data protection series](https://docs.kentico.com/guides/development/data-protection.md)
- A running instance of Xperience by Kentico, preferably [29.6.1](https://docs.kentico.com/changelog.md) or higher.

  > **Note:**&#x20;
  >
  >  Some features covered in the Training guides may not work in older versions. 

> **Info:** **Code samples**
>
> You can find a project with completed, working versions of code samples from this module and others in the [finished branch](https://github.com/Kentico/xperience-by-kentico-training-guides/tree/finished) of the _Training guides_ repository.
>
> The [main branch](https://github.com/Kentico/xperience-by-kentico-training-guides) of the repository provides a starting point to code along with the guides.
>
> The code samples in this guide are for [.NET 8](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-8/overview) only.
>
> They come from a project that uses [implicit using directives](https://learn.microsoft.com/en-us/dotnet/core/project-sdk/overview#implicit-using-directives). You may need to add additional `using` directives to your code if your project does not use this feature.
