You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scripts added by this plugin are hardcoded in wp_head. This makes detection and reuse more complex than it should be. We should instead register and enqueue scripts.
I was going to contribute this, however, it would have caused some other issues due to the way scripts are added/filtered, so instead I will share what I did for someone to implement in the future.
cc @layoutd this would make it easier for the listings plugin to re-use the tag manager script, instead of using filters and string replacements.
This needs work but the basic idea is to register the script with a handle, then use inline scripts to initialise with configs.
Scripts added by this plugin are hardcoded in
wp_head
. This makes detection and reuse more complex than it should be. We should instead register and enqueue scripts.I was going to contribute this, however, it would have caused some other issues due to the way scripts are added/filtered, so instead I will share what I did for someone to implement in the future.
cc @layoutd this would make it easier for the listings plugin to re-use the tag manager script, instead of using filters and string replacements.
This needs work but the basic idea is to register the script with a handle, then use inline scripts to initialise with configs.
Google Tag Manager:
Classic and Universal:
Then we can make them async:
I'm going to try to workaround this for now to avoid touching the plugin code.
The text was updated successfully, but these errors were encountered: