문제

My client has asked me to install Facebook pixel on there Magento 1 website. What I have received from them are the four text file 1. Add to Cart Pixel.txt 2. Initiate Checkout Pixel.txt 3. Page View Pixel.txt 4. Purchase Pixel.txt

The code inside AddTocart is

<script>
fbq('track', 'AddToCart', {
value: 1,
currency: 'USD',
});
</script>

Similar in other files also.

I have no idea how to proceed further. Where to add this code?

Can anyone suggest me on this further step?

Thanks in advance..!

올바른 솔루션이 없습니다

다른 팁

You can use this module to fulfill your requirements. https://marketplace.magento.com/cadence-cadence-fbpixel.html

This will be help full for you to load script for particular pages.

for cart page, you can use this

  1. Go to app/design/frontend/{package}/{theme}/layout/local.xml then add this :

    <checkout_cart_index>
        <reference name="head">
            <action method="addItem"><type>skin_js</type><name>js/my-custom.js</name></action>
        </reference>
    </checkout_cart_index>
    

2.Create your new js file in: skin/frontend/{package}/{theme}/js/my-custom.js then put your code inside.

  1. Now your js file will be just loaded in checkout/cart. Don't forget to clear the cache.

If you want to add js in the head of checkout page then use below code

<checkout_onepage_index translate="label">
          <reference name="head">
               <action method="addJs"><script>product_designer/checkout_image.js</script></action>
          </reference>
</checkout_onepage_index>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top