Search code examples
google-chrome-extensiongoogle-tag-manager

Is there way to debug events in GTM preview for someone else website with no access?


I need to be able to create tags and triggers in GTM in order to test if they will work on customer's website and if so I'll just export my container to them and they will import it.


Solution

  • enter image description here

    From the GTM code

    Only copy the code between <script></script>

    Like

    (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-WPBLD7R');
    

    And paste in Chrome Devtool's console But you need to paste every time you reload the page.

    Or find a chrome extension that can help you execute JS every time the page load. Then you can just paste the code on that tool.

    Then you can test GTM preview on the website you can't install the GTM