- Loads the Mautic Tracking Script.
- Extracts the
contact_idfrom the Mautic cookie. - Pass the
contact_idto Drupal’s endpoint
- Receives
contact_idfrom React. - Queries the Mautic API to get the visitor’s segments by contact_id.
- Checks if taxonomy terms corresponding to Mautic segments exist in Drupal. If not, creates them.
- Compares the
contact_id's segment against the taxonomy terms associated with each paragraph. - Sets paragraph visibility field value to (
visibleorinvisible) based on the match. - The paragraph visibility is then included in
paragraph.attributes.field_visibilitythe JSON API response and in Drupal UI - If no segment is identified or provided, all paragraphs are marked as
visible(default).
- Fetches paragraphs via the Drupal JSON API.
- Filters and renders paragraphs marked as
visible.
