Skip to content

Conversation

mkadsv
Copy link

@mkadsv mkadsv commented Mar 29, 2021

Description (*)

What Has Changed:

  • Google Adwords: added gtag library to utilize Google Adwords conversion tracking instead of image pixel
  • Google Adwords: "Conversion ID" field is required (updated UI to display required) and is a string input instead of Int
  • Google Adwords: All other fields are optional, updated ui to display optional
  • Google Analytics: added gtag library instead of analytics.js library
  • Google Analytics: Ability to use Google Analytics 4 properties or Universal Analytics Properties by adding a drop down menu to select the account type and Updated "Account Number" to "Measurement Id" if "Google Analytics" is selected and "Tracking Id" if "Universal Analytics" is selected.
  • Google Analytics: Anonymize IP will always be true for Google Analytics account type
  • Google Analytics: Removing "add to cart" event because it was being triggered simultaneously with "purchase" event.

Why:

  • gtag.js is is used instead of analytics.js to be able to support both legacy "Universal Analytics" users and the new Google Analytics 4 property. It allows for easier configuration with Google Ads for conversion tracking.
  • The "Tracking ID" input field and "Measurement ID" input field in Google Analytics must be a string since the syntax has changed. (GA-XXXX and UA-XXXX)
  • The "Conversion ID" input field in Google Adwords must be a string since the syntax has changed (AW-XXXXX).
  • The Add to Cart Event was removed since it was not being triggered correctly.

Manual testing scenarios (*)

  1. If user enables Google Analytics module, they can select from a drop down menu of "Google Analytics 4" or "Universal Analytics".
  2. Google Analytics: There will be "page_view" events triggered when a user views any frontend store page
  3. Google Analytics: There will be "purchase" events triggered when a user completes a checkout and lands on success page.
  4. Google Analytics: There will be no add_to_cart event.
  5. Google Adwords: when a user completes a purchase there will be a conversion event that occurs.

Questions or comments

It was noted in the developer guide to not utilize a module inside another module however, since Google Adwords and Google Analytics are tightly coupled and designed to work together. We must break this rule or else the module will not work correctly with Google Analytics and Google Ads as the provider has intended.

Fixes #35204

Contribution checklist (*)

  • [* ] Pull request has a meaningful description of its purpose
  • [ *] All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • [* ] All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Mar 29, 2021

Hi @mkadsv. Thank you for your contribution
Here are some useful tips 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

❗ 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:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

added unit tests and styling in admin.
@mkadsv
Copy link
Author

mkadsv commented Mar 30, 2021

@magento run all tests

@mkadsv
Copy link
Author

mkadsv commented Mar 30, 2021

@magento run Magento Health Index

@mkadsv
Copy link
Author

mkadsv commented Mar 30, 2021

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @mkadsv. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@mkadsv
Copy link
Author

mkadsv commented Mar 31, 2021

@magento run all tests

@Den4ik
Copy link
Contributor

Den4ik commented Jan 14, 2022

Hi @mkadsv.
Thanks for the comment.
It's correct to deprecate old methods instead of removing them

@bgorski
Copy link
Contributor

bgorski commented Jan 15, 2022

However, according to the Magento 2 Coding Standard, use of trigger_error() is discouraged (https://github.com/magento/magento-coding-standard/blob/v17/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php#L139). So while it may be tempting to use it, we should limit ourselves to just the @deprecated annotation. This way tests will pass (unless there are other reasons for them not to). There's more business value in having tests even for deprecated methods for as long as they're not entirely removed, than in having a more visible deprecation.

@mkadsv can you remove lines of code that use trigger_error() please?

@sidolov
Copy link
Contributor

sidolov commented Jan 21, 2022

@magento run all tests

@magento-automated-testing
Copy link

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.

@mkadsv
Copy link
Author

mkadsv commented Jan 21, 2022

@bgorski - as per slack convo, I have removed trigger_error functions since they are not compatible with Magento 2 Coding Standard.
I'm looking into the other unit tests failures

@sidolov
Copy link
Contributor

sidolov commented Jan 24, 2022

@magento run all tests

@magento-automated-testing
Copy link

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.

@bgorski
Copy link
Contributor

bgorski commented Jan 29, 2022

@magento run Integration Tests, Sample Data Tests B2B, Sample Data Tests EE

@magento-automated-testing
Copy link

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.

@bgorski
Copy link
Contributor

bgorski commented Feb 4, 2022

@magento run Sample Data Tests B2B, Sample Data Tests EE

@magento-automated-testing
Copy link

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.

@bgorski
Copy link
Contributor

bgorski commented Feb 16, 2022

@magento run Sample Data Tests B2B, Sample Data Tests EE

@magento-automated-testing
Copy link

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.

@bgorski
Copy link
Contributor

bgorski commented Mar 14, 2022

@magento run all tests

@magento-automated-testing
Copy link

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.

@bgorski
Copy link
Contributor

bgorski commented Mar 14, 2022

Not sure why it has been set to Progress: Review. Should be Progress: Needs Update. Setting the correct status now.

@oefterdal
Copy link

oefterdal commented Apr 26, 2022

Any progress on this issue? @Den4ik @bgorski

@sidolov
Copy link
Contributor

sidolov commented May 28, 2022

Feature merged on scope of #35376

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Frontend Component: GoogleAdwords Component: GoogleAnalytics feature request Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Release Line: 2.4 Risk: medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Google Universal Analytics will be EOL July 2023
8 participants