Version Notes
Tested on 1.9
Download this release
Release Info
Developer | Cadence Labs |
Extension | cadence_fbpixel |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.1.0
- app/code/community/Cadence/Fbpixel/etc/system.xml +6 -14
- app/design/frontend/base/default/layout/cadence_fbpixel.xml +1 -1
- app/design/frontend/base/default/template/cadence/fbpixel/conversion.phtml +6 -15
- app/design/frontend/base/default/template/cadence/fbpixel/visitor.phtml +14 -17
- package.xml +8 -13
app/code/community/Cadence/Fbpixel/etc/system.xml
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
</tabs>
|
9 |
<sections>
|
10 |
<cadence_fbpixel translate="label">
|
11 |
-
<label>Facebook
|
12 |
<tab>cadence</tab>
|
13 |
<frontend_type>text</frontend_type>
|
14 |
<sort_order>100</sort_order>
|
@@ -17,7 +17,7 @@
|
|
17 |
<show_in_store>1</show_in_store>
|
18 |
<groups>
|
19 |
<visitor translate="label">
|
20 |
-
<label>
|
21 |
<show_in_default>1</show_in_default>
|
22 |
<show_in_website>1</show_in_website>
|
23 |
<show_in_store>1</show_in_store>
|
@@ -33,18 +33,18 @@
|
|
33 |
<show_in_store>1</show_in_store>
|
34 |
</enabled>
|
35 |
<pixel_id translate="label">
|
36 |
-
<label>
|
37 |
<frontend_type>text</frontend_type>
|
38 |
<sort_order>20</sort_order>
|
39 |
<show_in_default>1</show_in_default>
|
40 |
<show_in_website>1</show_in_website>
|
41 |
<show_in_store>1</show_in_store>
|
42 |
-
<comment>This is the pixelId for the
|
43 |
</pixel_id>
|
44 |
</fields>
|
45 |
</visitor>
|
46 |
<conversion translate="label">
|
47 |
-
<label>Conversion
|
48 |
<show_in_default>1</show_in_default>
|
49 |
<show_in_website>1</show_in_website>
|
50 |
<show_in_store>1</show_in_store>
|
@@ -58,16 +58,8 @@
|
|
58 |
<show_in_default>1</show_in_default>
|
59 |
<show_in_website>1</show_in_website>
|
60 |
<show_in_store>1</show_in_store>
|
|
|
61 |
</enabled>
|
62 |
-
<pixel_id translate="label">
|
63 |
-
<label>Conversion Pixel ID</label>
|
64 |
-
<frontend_type>text</frontend_type>
|
65 |
-
<sort_order>20</sort_order>
|
66 |
-
<show_in_default>1</show_in_default>
|
67 |
-
<show_in_website>1</show_in_website>
|
68 |
-
<show_in_store>1</show_in_store>
|
69 |
-
<comment>This is the pixelId for the conversion tracking pixel (see the install guide for instructions on where to find this).</comment>
|
70 |
-
</pixel_id>
|
71 |
</fields>
|
72 |
</conversion>
|
73 |
</groups>
|
8 |
</tabs>
|
9 |
<sections>
|
10 |
<cadence_fbpixel translate="label">
|
11 |
+
<label>Facebook Pixel</label>
|
12 |
<tab>cadence</tab>
|
13 |
<frontend_type>text</frontend_type>
|
14 |
<sort_order>100</sort_order>
|
17 |
<show_in_store>1</show_in_store>
|
18 |
<groups>
|
19 |
<visitor translate="label">
|
20 |
+
<label>Facebook Pixel</label>
|
21 |
<show_in_default>1</show_in_default>
|
22 |
<show_in_website>1</show_in_website>
|
23 |
<show_in_store>1</show_in_store>
|
33 |
<show_in_store>1</show_in_store>
|
34 |
</enabled>
|
35 |
<pixel_id translate="label">
|
36 |
+
<label>Pixel ID</label>
|
37 |
<frontend_type>text</frontend_type>
|
38 |
<sort_order>20</sort_order>
|
39 |
<show_in_default>1</show_in_default>
|
40 |
<show_in_website>1</show_in_website>
|
41 |
<show_in_store>1</show_in_store>
|
42 |
+
<comment>This is the pixelId for the facebook pixel (see the install guide for instructions on where to find this).</comment>
|
43 |
</pixel_id>
|
44 |
</fields>
|
45 |
</visitor>
|
46 |
<conversion translate="label">
|
47 |
+
<label>Conversion Event (Optional)</label>
|
48 |
<show_in_default>1</show_in_default>
|
49 |
<show_in_website>1</show_in_website>
|
50 |
<show_in_store>1</show_in_store>
|
58 |
<show_in_default>1</show_in_default>
|
59 |
<show_in_website>1</show_in_website>
|
60 |
<show_in_store>1</show_in_store>
|
61 |
+
<comment>The base pixel must be enabled to track conversions.</comment>
|
62 |
</enabled>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
</fields>
|
64 |
</conversion>
|
65 |
</groups>
|
app/design/frontend/base/default/layout/cadence_fbpixel.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<layout version="0.1.0">
|
3 |
<default>
|
4 |
-
<reference name="
|
5 |
<block type="core/template" template="cadence/fbpixel/visitor.phtml" />
|
6 |
</reference>
|
7 |
</default>
|
1 |
<?xml version="1.0"?>
|
2 |
<layout version="0.1.0">
|
3 |
<default>
|
4 |
+
<reference name="head">
|
5 |
<block type="core/template" template="cadence/fbpixel/visitor.phtml" />
|
6 |
</reference>
|
7 |
</default>
|
app/design/frontend/base/default/template/cadence/fbpixel/conversion.phtml
CHANGED
@@ -3,7 +3,7 @@ $helper = Mage::helper("cadence_fbpixel");
|
|
3 |
if (!$helper->isConversionPixelEnabled()) {
|
4 |
return;
|
5 |
}
|
6 |
-
$id = $helper->
|
7 |
?>
|
8 |
<?php
|
9 |
$order_id = Mage::getSingleton('checkout/session')->getLastOrderId();
|
@@ -17,18 +17,9 @@ $grand_total = round($order->getGrandTotal(), 2);
|
|
17 |
$currency_code = Mage::app()->getStore()->getCurrentCurrencyCode();
|
18 |
?>
|
19 |
<!-- Facebook Conversion Code for Conversions -->
|
20 |
-
<script>
|
21 |
-
|
22 |
-
if (!_fbq.loaded) {
|
23 |
-
var fbds = document.createElement('script');
|
24 |
-
fbds.async = true;
|
25 |
-
fbds.src = '//connect.facebook.net/en_US/fbds.js';
|
26 |
-
var s = document.getElementsByTagName('script')[0];
|
27 |
-
s.parentNode.insertBefore(fbds, s);
|
28 |
-
_fbq.loaded = true;
|
29 |
-
}
|
30 |
-
})();
|
31 |
-
window._fbq = window._fbq || [];
|
32 |
-
window._fbq.push(['track', '<?php echo $id ?>', {'value':'<?php echo $grand_total ?>','currency':'<?php echo $currency_code ?>'}]);
|
33 |
</script>
|
34 |
-
<noscript><img height="1" width="1"
|
|
|
|
3 |
if (!$helper->isConversionPixelEnabled()) {
|
4 |
return;
|
5 |
}
|
6 |
+
$id = $helper->getVisitorPixelId();
|
7 |
?>
|
8 |
<?php
|
9 |
$order_id = Mage::getSingleton('checkout/session')->getLastOrderId();
|
17 |
$currency_code = Mage::app()->getStore()->getCurrentCurrencyCode();
|
18 |
?>
|
19 |
<!-- Facebook Conversion Code for Conversions -->
|
20 |
+
<script>
|
21 |
+
fbq('track', 'Purchase', {value: '<?php echo $grand_total ?>', currency: '<?php echo $currency_code ?>'});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
</script>
|
23 |
+
<noscript><img height="1" width="1" style="display:none"
|
24 |
+
src="https://www.facebook.com/tr?id=<?php echo $id ?>&ev=Purchase&value=<?php echo $grand_total ?>¤cy=<?php echo $currency_code ?>&noscript=1"
|
25 |
+
/></noscript>
|
app/design/frontend/base/default/template/cadence/fbpixel/visitor.phtml
CHANGED
@@ -5,20 +5,17 @@ if (!$helper->isVisitorPixelEnabled()) {
|
|
5 |
}
|
6 |
$id = $helper->getVisitorPixelId();
|
7 |
?>
|
8 |
-
<!-- Facebook
|
9 |
-
<script>
|
10 |
-
|
11 |
-
if
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
window._fbq.push(['track', 'PixelInitialized', {}]);
|
23 |
-
</script>
|
24 |
-
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?id=<?php echo $id ?>&ev=PixelInitialized" /></noscript>
|
5 |
}
|
6 |
$id = $helper->getVisitorPixelId();
|
7 |
?>
|
8 |
+
<!-- Facebook Pixel Code -->
|
9 |
+
<script>
|
10 |
+
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
|
11 |
+
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
|
12 |
+
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
|
13 |
+
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
|
14 |
+
document,'script','//connect.facebook.net/en_US/fbevents.js');
|
15 |
+
|
16 |
+
fbq('init', '<?php echo $id ?>');
|
17 |
+
fbq('track', "PageView");</script>
|
18 |
+
<noscript><img height="1" width="1" style="display:none"
|
19 |
+
src="https://www.facebook.com/tr?id=<?php echo $id ?>&ev=PageView&noscript=1"
|
20 |
+
/></noscript>
|
21 |
+
<!-- End Facebook Pixel Code -->
|
|
|
|
|
|
package.xml
CHANGED
@@ -1,18 +1,13 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>cadence_fbpixel</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license>GNU GPL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>This extension allows you to quickly implement Facebook tracking and conversion code on your Magento store. Supports Visitor
|
10 |
-
<description><p>This Facebook Conversion Code extension allows you to quickly implement
|
11 |
-
<p>You may set pixel ids for:</p>
|
12 |
-
<ul>
|
13 |
-
<li>Facebook Visitor Pixel (code is displayed on every page)</li>
|
14 |
-
<li>Facebook Conversion Pixel (code is displayed only upon successful checkout)</li>
|
15 |
-
</ul> 
|
16 |
<p>Click here to view the official
|
17 |
<a href="http://www.cadence-labs.com/2015/03/free-magento-mail-chimp-popup-extention/" title="User Manual">Facebook Tracking &amp; Conversion Code User Guide</a> with detailed step-by-step instructions. </p>
|
18 |
<h2>Tracks Currency &amp; Grand Total</h2>
|
@@ -21,10 +16,10 @@
|
|
21 |
<h2>About The Developer</h2>
|
22 |
<p><a href="http://www.cadence-labs.com/" title="Cadence Labs">Cadence Labs</a> is a digital marketing, design, and Magento agency based in Boulder, Colorado. Our developers are Magento certified eCommerce geeks!</p></description>
|
23 |
<notes>Tested on 1.9</notes>
|
24 |
-
<authors><author><name>Cadence Labs</name><user>
|
25 |
-
<date>2015-
|
26 |
-
<time>
|
27 |
-
<contents><target name="magecommunity"><dir name="Cadence"><dir name="Fbpixel"><dir name="Helper"><file name="Data.php" hash="473e99657209bd2e1639640321cf0ae3"/></dir><dir name="etc"><file name="adminhtml.xml" hash="5b6a3e063450264720f766584dbd5055"/><file name="config.xml" hash="6cd8b235fdc17c943bb6efb3dda75e52"/><file name="system.xml" hash="
|
28 |
<compatible/>
|
29 |
-
<dependencies><required><php><min>5.2.0</min><max>5.6.
|
30 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>cadence_fbpixel</name>
|
4 |
+
<version>1.1.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GNU GPL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>This extension allows you to quickly implement Facebook tracking and conversion code on your Magento store. Supports Visitor and Purchase tracking events through the Facebook pixel</summary>
|
10 |
+
<description><p>This Facebook Conversion Code extension allows you to quickly implement visitor and purchase events through the new Facebook Pixel. <a href="http://www.cadence-labs.com/2015/03/free-magento-mail-chimp-popup-extention/" title="User Manual"><strong>Learn how it works.</strong></a>. </p>
|
|
|
|
|
|
|
|
|
|
|
11 |
<p>Click here to view the official
|
12 |
<a href="http://www.cadence-labs.com/2015/03/free-magento-mail-chimp-popup-extention/" title="User Manual">Facebook Tracking &amp; Conversion Code User Guide</a> with detailed step-by-step instructions. </p>
|
13 |
<h2>Tracks Currency &amp; Grand Total</h2>
|
16 |
<h2>About The Developer</h2>
|
17 |
<p><a href="http://www.cadence-labs.com/" title="Cadence Labs">Cadence Labs</a> is a digital marketing, design, and Magento agency based in Boulder, Colorado. Our developers are Magento certified eCommerce geeks!</p></description>
|
18 |
<notes>Tested on 1.9</notes>
|
19 |
+
<authors><author><name>Cadence Labs</name><user>alan@cadence-labs.com</user><email>alan@cadence-labs.com</email></author></authors>
|
20 |
+
<date>2015-12-27</date>
|
21 |
+
<time>00:05:44</time>
|
22 |
+
<contents><target name="magecommunity"><dir name="Cadence"><dir name="Fbpixel"><dir name="Helper"><file name="Data.php" hash="473e99657209bd2e1639640321cf0ae3"/></dir><dir name="etc"><file name="adminhtml.xml" hash="5b6a3e063450264720f766584dbd5055"/><file name="config.xml" hash="6cd8b235fdc17c943bb6efb3dda75e52"/><file name="system.xml" hash="17100ac3d7e76238368a4bf09b564a30"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Cadence_Fbpixel.xml" hash="3a82d06be6deb217df2bf11c543bc068"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="cadence_fbpixel.xml" hash="3287578213b7a92169d531606efbb9a4"/></dir><dir name="template"><dir name="cadence"><dir name="fbpixel"><file name="conversion.phtml" hash="956fccead55a19c4b19f3b8cbe71ffee"/><file name="visitor.phtml" hash="7752c825fd59c10b6971353d2e65fcd8"/></dir></dir></dir></dir></dir></dir></target></contents>
|
23 |
<compatible/>
|
24 |
+
<dependencies><required><php><min>5.2.0</min><max>5.6.9</max></php></required></dependencies>
|
25 |
</package>
|