Support » Plugin: Google Tag Manager for WordPress » Suggestion: Add apply_filters() to the gtm4wp_woocommerce_datalayer_filter_items

  • Resolved tomaskavalek


    Please, add the apply_filters to the end of gtm4wp_woocommerce_datalayer_filter_items to allow modification of $dataLayer variable before it’s rendered and send to the browser.

    Thanks a lot. I don’t want to fork your repo due to this small piece of code.

    Is it possible?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Thomas Geiger



    Sorry for this late reply.
    There is a more general filter: gtm4wp_compile_datalayer
    If you use this, you will get the full dataLayer during each pageload so that you can change content as you wish

    Would this satisfy your needs?

    Thread Starter tomaskavalek



    thank you very much. It’s exactly filter what I need. Well done. I don’t understand how I could miss that.

    Thanks a lot.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Suggestion: Add apply_filters() to the gtm4wp_woocommerce_datalayer_filter_items’ is closed to new replies.