Skip to content

Commit

Permalink
feat: add tracking section
Browse files Browse the repository at this point in the history
  • Loading branch information
thedaviddias committed Feb 9, 2025
1 parent e4a2d04 commit 043cb35
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
54 changes: 54 additions & 0 deletions content/en/patterns/content-management/carousel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,60 @@ graph TD
- Avoid **large DOM structures**—if the carousel contains many slides, use virtualized rendering.
- Don't use **excessive animations** that could impact performance on lower-powered devices.

## Tracking

Tracking carousel interactions helps measure engagement, detect usability issues, and optimize content placement. By capturing key user actions, we can analyze how effectively the carousel is driving interaction and whether users engage with slides beyond the first one.

### Key Tracking Points

Each carousel interaction provides valuable insights into user behavior. Below are the key events that should be tracked:

| **Event Name** | **Description** | **Why Track It?** |
| ---------------------------- | -------------------------------------------------- | ---------------------------------------------------------------- |
| `carousel.view` | When the carousel first enters the viewport. | Helps determine if users even see the carousel. |
| `carousel.slide_change` | When a user navigates to a different slide. | Measures engagement and content interest. |
| `carousel.auto_rotate_pause` | When a user **pauses auto-rotation** (if enabled). | Indicates if auto-rotation is frustrating users. |
| `carousel.click` | When a user clicks on a slide. | Helps measure which slides attract the most attention. |
| `carousel.swipe` | When a user swipes on mobile. | Tracks touch engagement separately from clicks. |
| `carousel.see_all_click` | When users click the **"See All"** link. | Indicates if users want more content than the carousel provides. |

### Event Payload Structure

To ensure consistent tracking, here’s a recommended event format:

```json
{
"event": "carousel.slide_change",
"properties": {
"carousel_id": "homepage_featured",
"slide_index": 3,
"total_slides": 5,
"interaction_type": "click" // or "swipe"
}
}
```

### Insights & Optimization Based on Tracking

By analyzing tracking data, we can optimize the carousel experience:

- 📉 **High Drop-off Rate?**
→ Users might not be interested in later slides. Consider making the first slides more engaging, reducing the number of slides, or testing a different pattern (e.g., a grid or tabbed interface).

- 🔄 **Frequent Auto-Play Pauses?**
→ Users may find auto-rotation too fast or distracting. Slow down transitions, increase delay times, or disable autoplay by default.

- 📊 **Low Click-Through Rate (CTR)?**
→ The slides might not be engaging enough. Test different visuals, headlines, and CTAs to improve interaction.

- 📱 **More Swipes than Clicks?**
→ Mobile users may interact differently than desktop users. Optimize for touch gestures and ensure swipe responsiveness.

- 🚀 **High "See All" Click Rate?**
→ The carousel might not be displaying enough relevant content upfront. Consider making more items visible at once or leading users to a dedicated content hub.

By continuously monitoring these metrics, we can refine the carousel’s effectiveness and improve overall user engagement.

## Code Examples

### Basic Implementation
Expand Down
35 changes: 35 additions & 0 deletions content/en/patterns/forms/password.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ status: complete

import { BrowserSupport } from "@app/_components/browser-support";
import { BuildEffort } from "@app/_components/build-effort";
import { FaqStructuredData } from "@app/_components/faq-structured-data";

## Overview

Expand Down Expand Up @@ -142,3 +143,37 @@ Password fields are commonly used in **authentication forms, account creation, a
- [Text Field](/patterns/forms/text-field) – Standard input for non-sensitive text.
- [Two-Factor Authentication](/patterns/security/2fa) – Additional authentication layer.
- [Security Best Practices](/patterns/security/best-practices) – Guidelines for secure input handling.

## Frequently Asked Questions

<FaqStructuredData
items={[
{
question: "What is a password input field?",
answer:
"A password input field is a form element that allows users to enter sensitive information securely. The input is typically masked to prevent onlookers from viewing the entered text.",
},
{
question: "How can I enhance the usability of password input fields?",
answer:
"Enhance usability by providing a 'Show Password' toggle, displaying password requirements upfront, and offering a password strength meter to guide users in creating strong passwords.",
},
{
question:
"What are best practices for password input field accessibility?",
answer:
"Ensure the password field is focusable, provide clear labels, support keyboard navigation, and offer options to unmask the password for verification purposes.",
},
{
question:
"Should I use one or two password fields during account creation?",
answer:
"It's increasingly common to use a single password field with a 'Show Password' option, as this simplifies the process and allows users to verify their input without requiring a second confirmation field.",
},
{
question: "How can I inform users about password requirements?",
answer:
"Display password requirements near the input field, either by default or when the field is focused, to ensure users are aware of the criteria as they create their password.",
},
]}
/>
6 changes: 6 additions & 0 deletions templates/patterns/component.mdx.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ end
- [Anti-pattern 1]
- [Anti-pattern 2]

## Tracking

### Event Tracking

### Insights & Optimization Based on Tracking

## Code Examples

### Basic Implementation
Expand Down

0 comments on commit 043cb35

Please sign in to comment.