Needs review
Project:
Google Tag
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Dec 2023 at 12:54 UTC
Updated:
19 Feb 2026 at 14:11 UTC
Jump to comment: Most recent
Comments
Comment #3
berdirIntroduced a method on the trait used it on all events where it makes sense, only exception is commerce_view_item_list, which calls it item but it's a product variation.
Also added an event and a test that verifies it works.
MR needs work on docs and trait doesn't use DI, that's a bit awkward as every plugin class would need to do the whole DI dance, probably even with BC?
Comment #4
newaytech commentedFantastic @Berdir - thanks for the contrib...
Comment #5
berdirFixed a missing use. Not sure why it's still a Build Successful and not a pass, https://dispatcher.drupalci.org/job/drupal_contrib/724221/console seems OK to me.
Comment #6
berdirI pushed a few updates. I didn't realize that $item is sometimes an order item and sometimes it's actually a product variation. The naming really doesn't help there.
So there are now two methods on the trait and two events. Still would like some first feedback before finishing this up with comments and so on.
Comment #7
japerryOn first glance this looks great! Waiting to see if I can get the new test suite to pass, I committed some changes a week ago that fixed tests for Drupal 10.
Comment #8
rszrama commentedTagging and cross-referencing #3358305: Add alter event processing to collector as one or the other (or both?) of these approaches will be needed. A more general solution for altering event data seems to make sense, though ... for example, determining what coupon code should be present on a purchase event when multiple coupon codes have been applied to an order.
Comment #12
primsi commentedUpdating mr to address php 8.4 deprecations