Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Michael K

    (@mikkamp)

    Automattic Happiness Engineer

    Hi,

    The Google Analytics Integration plugin adds the JavaScript to the add to cart button through default WooCommerce hooks.

    It’s only included once there on your site. However it seems the theme is copying over all the text to get the tooltip title. In this case that would be specific code which is part of the theme, so it would be best to contact the theme authors, to see how that can be resolved.

    Thread Starter polisafety

    (@polisafety)

    Thank you very much for your assistance.

    I already spoke with the theme developer a couple of weeks ago and I told him the exact same issue that you described me.
    He advised the code to be injected in the footer instead of the button itself.

    So I am kind of in the middle here. Is there anything else that I can do from my part?

    Plugin Author Michael K

    (@mikkamp)

    Automattic Happiness Engineer

    The plugin doesn’t allow any way to customize that. So the only way would be to customize the code itself. This isn’t usually recommended though, as you will lose any of your changes when you update the plugin.

    But if you are a bit handy with PHP I’d suggest to have a look at the function listing_click in the file woocommerce-google-analytics-integration/includes/class-wc-google-analytics-js.php

    If you change the echo call to wp_enqueue_js it will load the JavaScript in the footer instead. Note that you will need to also strip off the beginning and ending <script> tags for that to work.

    Thread Starter polisafety

    (@polisafety)

    I really appreciate your assistance!
    Your suggestion helped me solve the issue, at least for now.

    Thank you very much once more.
    Best regards!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Code leak on tooltips’ is closed to new replies.