• Resolved waqaszafar

    (@waqaszafar)


    Hi, I have installed autoptimize and also activated the optimize the JS option but issue is that turning this option on does allow the google tag manager code run. I have attached the screenshot of the settings for JS section.

    View post on imgur.com

    so, as soon as I turn this option on, the Google Tag manager stops working. It does even let that code appear in html elements when checked via inspect elements.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    So as soon as you tick “optimize JavaScript”, without ticking any of the sub-options, GTM does not work any more? that’s _very_ surprising.

    can you copy/paste the HTML of the page when JS opt. is on to a pastebin.com paste or a github gist so I can review the HTML?

    Thread Starter waqaszafar

    (@waqaszafar)

    Hi, while copying the HTML for you, I noticed it was being minified and that’s what was resulting in breaking of the GTM code. I just disabled and now it is working fine.

    Thank you very much for fast response.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    ah, the “minify inline” option you mean. alternatively you could also exclude the GTM code from being minified by adding e.g. gtm or googletagmanager to the JS optimization exclusion list.

    have a nice day,
    frank

    Thread Starter waqaszafar

    (@waqaszafar)

    Thank you for the prompt reply and sorry for not writing back to you earlier. It was solved using not minifying HTML (just in case someone else encounters it).

    Love your plugin BTW.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you’re welcome, feel free to leave a review of the plugin and support here! ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Autoptimize won’t let google tag manager work’ is closed to new replies.