- Issue created by @introfini
- Assigned to introfini
- Status changed to Fixed
about 1 year ago 8:26am 24 October 2023 - 🇵🇹Portugal introfini
Here's a way:
// Add the GA user_id to google_tag function bloom_custom_page_attachments_alter(array &$attachments) { $current_user = \Drupal::currentUser(); if (isset($attachments["#attached"]["drupalSettings"]["gtag"]) && $current_user->isAuthenticated()) { $attachments["#attached"]["drupalSettings"]["gtag"]["additionalConfigInfo"]['user_id'] = 'drupal-user-id-' . $current_user->id(); } }
Automatically closed - issue fixed for 2 weeks with no activity.