-
-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing invalid null-return in Google Analytics #3438
Conversation
Hello @daboss84, thanks for reporting these issues. What about a more granular selection like this? Also, fix a case where the category is not active but is being incorrectly tracked. (we have some customers that put products in hidden categories for internal purpose)
Test conducted: correct skip Categories of "Secondary Website" and disabled categories "New arrivals 1.2"
without excluding no active categories add_to_cart tracks it wrong:
(in this case view_item event picks category from current_category registry, while add_to_cart selects the last category but it is not active) If I re-enable "New Arrivals 1.2," it correctly picks it. |
I think we should use a collection instead of a "load in a loop", the performance hit (in this case) wouldn't be big but a collection just looks better and safer |
Hi, |
@daboss84 sorry for the delay, I'd merge @empiricompany's PR alexh-swdev#1 cause a collection it's always safer than loading a in a loop, I'll try to test it our as soon as it gets published here ;-) |
fix ga4 category tracking
Co-authored-by: Fabrizio Balliano <fabrizio.balliano@gmail.com>
phpstan is not happy |
What does that mean exaclty? What do we have to do? (I am new to PR's and I only know PHPStan exists but not really what for unfortunately) |
@daboss84 merge last review suggests from @fballiano and should be fix also phpstan this is the correct version:
|
Ah ok, thanks. Yes I can do that in the evening (in a couple of hours) |
I've pushed a new version to this PR, let me know if it works for you |
Hi @fballiano I just run a quick test and it looks to me, like the category is empty now. |
the problem is this commit ad9d881
condition results: like '2/%' where 2 is the root category of store in my version i'm using getPath() that return 1/2 including root category id avoiding this issues
|
I just committed those changes. Now it looks like it's working in my test environment. |
I think the first time I've to approve the workflow run. sorry about the rootCategory thing, I tested it in my environment and it was working fine and I really wanted to avoid another model load... |
Description / Fixed Issues (*)
See #3435 :
The problem is, that the _categorieIds contains ALL its categories, of all its subshops. The poped category is not from the subshop from where it is added to the cart. Probably that's why the category is not loaded and its name is null.