Skip to content
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

Added support for Google Analytics 4 Enhanced eCommerce #3198

Merged
merged 15 commits into from
May 18, 2023

Conversation

discountscott
Copy link
Contributor

@discountscott discountscott commented Apr 19, 2023

Description (*)

Adds support for enhanced eCommerce event data in GA4.

Creates events for product view, category view, add to cart, remove from cart, cart view, begin checkout. Purchase events are already being sent.

Details on implementation from Google can be found here: https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtag

Related Pull Requests

Fixed Issues (if relevant)

Manual testing scenarios (*)

  1. Configure/Enable GA4
  2. Set new config option Enable Enhanced eCommerce to YES
  3. Visit a category page
  4. Immediately after the gtag config will be the event view_item_list

Screenshots from Google Analytics Tag Debugging:
DFS-SDM-4-19-2023- 3 41 53 PM- 0
DFS-SDM-4-19-2023- 3 41 24 PM- 0
DFS-SDM-4-19-2023- 3 45 37 PM- 0
DFS-SDM-4-19-2023- 3 45 23 PM- 0

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)
  • Add yourself to contributors list

@github-actions github-actions bot added Component: GoogleAnalytics Relates to Mage_GoogleAnalytics Template : base Relates to base template translations Relates to app/locale labels Apr 19, 2023
app/code/core/Mage/GoogleAnalytics/Block/Ga.php Outdated Show resolved Hide resolved
app/code/core/Mage/GoogleAnalytics/Block/Ga.php Outdated Show resolved Hide resolved
app/code/core/Mage/GoogleAnalytics/Block/Ga.php Outdated Show resolved Hide resolved
app/code/core/Mage/GoogleAnalytics/Block/Ga.php Outdated Show resolved Hide resolved
Co-authored-by: Fabrizio Balliano <fabrizio.balliano@gmail.com>
@fballiano
Copy link
Contributor

I'd suggest to make the PR "editable by admins" ;-)

@discountscott discountscott marked this pull request as ready for review April 19, 2023 19:51
Co-authored-by: Fabrizio Balliano <fabrizio.balliano@gmail.com>
@discountscott
Copy link
Contributor Author

I'd suggest to make the PR "editable by admins" ;-)

try now - it was still a draft, maybe why you couldn't edit.

@fballiano
Copy link
Contributor

mmm shouldn't be that, there's no "Add more commits by pushing to the..." message, it should be managed though something like this: https://github.blog/changelog/2023-02-10-see-when-a-pull-request-is-editable-by-maintainers/

@fballiano
Copy link
Contributor

thank you for this PR because it's a great feature to have!!

@discountscott
Copy link
Contributor Author

mmm shouldn't be that, there's no "Add more commits by pushing to the..." message, it should be managed though something like this: https://github.blog/changelog/2023-02-10-see-when-a-pull-request-is-editable-by-maintainers/

On user-owned forks, if you want to allow anyone with push access to the upstream repository to make changes to your pull request, select Allow edits from maintainers.

That button doesn't exist for me... Maybe because it's not technically a user-owned fork (as it's owned by our company not my acct personally)? hmmmm

@fballiano
Copy link
Contributor

@discountscott could be, it's not a problem at the moment anyway :-)

@discountscott
Copy link
Contributor Author

@discountscott could be, it's not a problem at the moment anyway :-)

Looks like that is the issue, GitHub support ticket response:

I apologize for the trouble, but the ability to Allow edits from maintainers is only available for forks owned by a personal account and is not currently available for Organization owned forks.

We do have an open internal feedback issue around this and I have noted your interest in this feature, however please note that we can't say if/when this feature will been added.

empiricompany
empiricompany previously approved these changes May 9, 2023
@fballiano
Copy link
Contributor

Hi @discountscott, do you think you'll be able to check the changes we discussed and the new suggestions? this PR is very interesting but if you wan't finish it I'd have to reopen it (as a new one) in order to be able to modify it.

@discountscott
Copy link
Contributor Author

l be able to check the changes we discussed and the new suggestions? this PR is very interesting but if you wan't finish it I'd have to reopen it (as a ne

I apologize for the delay in these changes being implemented... I'll try and implement this week

@discountscott
Copy link
Contributor Author

@fballiano Should be good to go now. No longer has the admin preference and it is integrated right into the standard GA4 implementation.

Co-authored-by: Fabrizio Balliano <fabrizio.balliano@gmail.com>
@fballiano fballiano changed the title Google Analytics (GA4) Enhanced eCommerce Added support for Google Analytics 4 Enhanced eCommerce May 17, 2023
Co-authored-by: Fabrizio Balliano <fabrizio.balliano@gmail.com>
@fballiano fballiano merged commit 12aab25 into OpenMage:main May 18, 2023
15 checks passed
@ADDISON74
Copy link
Contributor

It was good that we merged it. If changes or improvements are requested, we will know soon because the old code will no longer be functional. A good evaluation possibility to find out how many still use the Magento 1 platform too.

@discountscott discountscott deleted the enhanced-ecomm branch May 19, 2023 13:30
@kyrena
Copy link
Contributor

kyrena commented Jun 23, 2023

I saw that two observers has been added with this PR.
But if we do not use Google Analytics 4, this observers are useless?
Not sure if adding a ifconfig (in xml will be a new lovely feature) can be usefull or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: GoogleAnalytics Relates to Mage_GoogleAnalytics translations Relates to app/locale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants