0

I want to add the script in the head.phtml but i need the product's id, SKU. So i only want it to work when is on the product Detail page.

1
  • You can setup rules in google tag manager so it only triggers on the the product page
    – PaddyD
    Nov 7, 2019 at 15:32

1 Answer 1

0

I have found the solution:

$_product = Mage::registry("current_product")
    if ($_product && $_product->getId()) :
        //google tag code here
    endif;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.