I am trying to implement GTM(google tag manager) with a community following this article.

The problem I am experiencing is that GTM cannot see the lightning web components that were loaded in the community page. To solve this I am firing CustomEvents which bubble up all the way up to GTM(being loaded in the markup header) and that is working fine.

However I couldn't find anything about CustomEvents and if Salesforce plans on controlling the way those propagate in the future.


Providing some code as a reference:


<div class="outter-wrapper">
    <div onclick={chatClick}></div>


chatClick() {
    if (this.template.querySelectorAll('.outter-wrapper')[0]) {
        let chatEvent = new CustomEvent(
                        detail: {
                            startChat: true
                        bubbles: true,
                        cancelable: true

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.