participedia / api

Website and API for Participedia V3
https://participedia.net
MIT License
20 stars 14 forks source link

Track when topics are selected from either the general issues or spec… #1161

Closed Tinydera closed 2 weeks ago

Tinydera commented 2 weeks ago

Track topic selections in Google Analytics

Description

Added Google Analytics event tracking for topic selections in case forms. The changes include:

  1. Added dataLayer push tracking in edit-multi-select.js for:
    • Topic selection events (when users select topics)
    • Topic removal events (when users remove topics)
  2. Tracking data includes:
    • Event name ('topicSelection' or 'topicRemoval')
    • Topic name (selected/removed topic)
    • Topic category (general_issues or specific_topics)
    • Case ID

Context/Issue Link

This change helps track user interactions with topic selections to understand:

Related to analytics implementation for understanding topic selection patterns

How has this been tested? How can it be tested?

To test:

  1. Open a case edit or creation form
  2. Select topics from either general issues or specific topics dropdowns
  3. Remove some topics
  4. Verify in Google Tag Manager preview mode that:
    • 'topicSelection' events fire when topics are selected
    • 'topicRemoval' events fire when topics are removed
    • All event parameters (topicName, topicCategory, caseId) are present

Screenshots (if it's a frontend change)

Not applicable as this is tracking implementation without UI changes