Drupal.behaviors.google_tag_events may not triggered after ajax

Created on 9 December 2022, almost 2 years ago
Updated 23 January 2024, 10 months ago

Problem/Motivation

processAjaxCommandCurrentEvents function return a SettingsCommand which are not call Drupal.attachBehaviors, see "core/misc/ajax.js". In these case drupalSettings may be updated, but events are not sending.

Steps to reproduce

Execute ajax which are not cause DOM update.

Proposed resolution

I assume that the correct solution is to make a custom ajax command based on SettingsCommand and add a Drupal.behaviors.google_tag_events call there. This command should be used instead of SettingsCommand in processAjaxCommandCurrentEvents. Or it may be another custom command, but in this case it should be executed immediately after the standard SettingsCommand in the same function.

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

🇧🇾Belarus Egor Kolzun

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024