openedx / frontend-platform

A framework for Open edX micro-frontend applications.
http://openedx.github.io/frontend-platform
GNU Affero General Public License v3.0
32 stars 64 forks source link

feat: Add support for Google Tag Manager #631

Open xitij2000 opened 10 months ago

xitij2000 commented 10 months ago

This change adds support for Google Tag Manager along with some common options for Google Tag Manager.

Google Tag Manager is a tag management system that can be used for conversion tracking, analytics etc. This change will allow configuring and using GTM in addition to Google Analytics.

openedx-webhooks commented 10 months ago

Thanks for the pull request, @xitij2000!

What's next?

Please work through the following steps to get your changes ready for engineering review:

:radio_button: Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

:radio_button: Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

:radio_button: Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

:radio_button: Let us know that your PR is ready for review:

Who will review my changes?

This repository is currently maintained by @openedx/committers-frontend. Tag them in a comment and let them know that your changes are ready for review.

Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

:bulb: As a result it may take up to several weeks or months to complete a review and merge your PR.

codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 83.90%. Comparing base (ad936a2) to head (64f4e85). Report is 71 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #631 +/- ## ========================================== + Coverage 83.50% 83.90% +0.40% ========================================== Files 40 41 +1 Lines 1073 1100 +27 Branches 197 204 +7 ========================================== + Hits 896 923 +27 Misses 165 165 Partials 12 12 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mphilbrick211 commented 10 months ago

Hi @openedx/fed-bom @openedx/2u-fed-bom! (not sure which group to use). This is ready for review. Thanks!

mphilbrick211 commented 7 months ago

Hi @openedx/2u-fed-bom! Just following up on this :)

xitij2000 commented 7 months ago

could please provide some more context of this change and its impact

I've updated the PR description, do tell if there is need for additional context or info.

xitij2000 commented 5 months ago

(This started as a conversation in #wg-frontend. Transcribing here.)

This looks like it would be useful, so I don't want to get in the way. At the same time, I think it would make a lot of sense if we could, instead of adding explicit support for GTM in frontend-platform, make it so that people could add any such script they want without having to submit it upstream. The advantages being:

* For the user: no need to try and get it merged

* For the maintainer: no need to make sure specific providers continue to work, are compliant, etc

I'm thinking that if one could define GoogleTagManagerLoader in an array of such loaders in env.config.js with a predefined name... say, externalScripts? Then all we need to do here is make sure that initialize() also (or instead) looks for external scripts that come from env.config.

Thoughts?

I already replied there but my only issue with reading externalScripts from env.config.js is that we can use a plugin mechanism to auto-load it instead. i.e. auto-populate that array with all packages following the pattern @openedx-plugins/frontend-platform-script-* .

Of course, someone can just install the package and manually populate it as well, and that will likely be simpler. I can work on that approach when we have the capacity to continue this work.

arbrandes commented 5 months ago

auto-populate that array with all packages following the pattern @openedx-plugins/frontend-platform-script-*

I think that's a fine idea. I figure we could support both mechanisms, though. Auto- and manual loading.

mphilbrick211 commented 3 months ago

Hi @xitij2000 - just checking in to see if this is still in progress?

xitij2000 commented 2 months ago

Hi @xitij2000 - just checking in to see if this is still in progress?

Sorry for the late reply. I'm hoping to work on this in an upcoming sprint.