magento2
magento2 copied to clipboard
Fix issue #37348: Google GTag add ecommerce data fix.
- Currency was moved to order object.
- Escapers was changed to be in harmony of "non-deprecated" ones.
Description (*)
Related Pull Requests
Fixed Issues (if relevant)
- Fixes magento/magento2#37348
Manual testing scenarios (*)
- ...
- ...
Questions or comments
Contribution checklist (*)
- [ ] Pull request has a meaningful description of its purpose
- [x] All commits are accompanied by meaningful commit messages
- [x] All new or changed code is covered with unit/integration tests (if applicable)
- [ ] README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
- [ ] All automated tests passed successfully (all builds are green)
Hi @Bashev. Thank you for your contribution! Here are some useful tips on how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:
@magento give me test instance- deploy test instance based on PR changes@magento give me 2.4-develop instance- deploy vanilla Magento instance
:exclamation: Automated tests can be triggered manually with an appropriate comment:
@magento run all tests- run or re-run all required tests against the PR changes@magento run <test-build(s)>- run or re-run specific test build(s) For example:@magento run Unit Tests
<test-build(s)> is a comma-separated list of build names.
Allowed build names are:
Database CompareFunctional Tests CEFunctional Tests EEFunctional Tests B2BIntegration TestsMagento Health IndexSample Data Tests CESample Data Tests EESample Data Tests B2BStatic TestsUnit TestsWebAPI TestsSemantic Version Checker
You can find more information about the builds here :information_source: Run only required test builds during development. Run all test builds before sending your pull request for review.
For more details, review the Code Contributions documentation. Join Magento Community Engineering Slack and ask your questions in #github channel.
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
@magento run Sample Data Tests B2B, Sample Data Tests EE, Functional Tests B2B, Functional Tests EE, Integration Tests, Static Tests, Unit Tests, WebAPI Tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
@Bashev Appreciate the good work you are putting into this.
I have also looked into this and found that by including currency and changing the number values to be outputted correctly (removing quotation marks, following Google docs), Google now reads it as e-commerce data and includes it as revenue.
Which issues are you facing? I thought about creating a simple PR, but it looks like you are being more thorough and solving more things than me.
@kasperth if currency is not on the order level GA not recognize order amount and everytime is reported as 0. When move the currency inside the order start working properly. Your finding is correct,. During the fix i add additional things as coupons and discounts into the datalayer which will be send to GA.
Unfortunately some of these changes reflect to changes of __construct of the Ga Block, composer.json and as result this is the reason for failed jobs.
Someone from the team need to support this PR.
@Bashev I have a suggestion for your pull request. I can see that you are approaching two different things.
- Fixing the revenue tracking (by implementing the currency code).
- Enhancing and improving revenue tracking.
I suggest splitting this into two pull requests/issues, so these can be handled separately. This way, we can use the 1) fix for revenue as a patch, and shops can implement it ASAP, without having to rely on the improvements you are adding as well.
For example, we would like to use an official pull request to solve this using the patch module but are currently not able to, as we only need the currency fix. If we create our own PR with the currency fix, it will be closed as a duplicate.
I'll gladly assist in creating a PR with the currency code if you remove it from this one.
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.
@magento run Functional Tests B2B
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.
I have no idea how to solve this failing test, its only on B2B.
already fixed, with some minor differences.
@magento run all tests
@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, Static Tests, Unit Tests
@magento run all tests
@magento run all tests
Fixed Unit test failures and other failing tests are not related to PR changes and some of them are known failure.
Hence moving it to Pending Review
@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, WebAPI Tests