cadence_fbpixel - Version 1.1.0

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 CHANGED
@@ -8,7 +8,7 @@
8
  </tabs>
9
  <sections>
10
  <cadence_fbpixel translate="label">
11
- <label>Facebook Pixels</label>
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>Visitor 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,18 +33,18 @@
33
  <show_in_store>1</show_in_store>
34
  </enabled>
35
  <pixel_id translate="label">
36
- <label>Visitor 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 visitor tracking 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 Pixel</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,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="after_body_start">
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->getConversionPixelId();
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>(function() {
21
- var _fbq = window._fbq || (window._fbq = []);
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" alt="" style="display:none" src="https://www.facebook.com/tr?ev=<?php echo $id ?>&amp;cd[value]=<?php echo $grand_total ?>&amp;cd[currency]=<?php echo $currency_code ?>&amp;noscript=1" /></noscript>
 
 
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 ?>&currency=<?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 Tracking Pixel for Visitors -->
9
- <script>(function() {
10
- var _fbq = window._fbq || (window._fbq = []);
11
- if (!_fbq.loaded) {
12
- var fbds = document.createElement('script');
13
- fbds.async = true;
14
- fbds.src = '//connect.facebook.net/en_US/fbds.js';
15
- var s = document.getElementsByTagName('script')[0];
16
- s.parentNode.insertBefore(fbds, s);
17
- _fbq.loaded = true;
18
- }
19
- _fbq.push(['addPixelId', '<?php echo $id ?>']);
20
- })();
21
- window._fbq = window._fbq || [];
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 ?>&amp;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.0.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 Tracking and Conversion (Checkout) Pixels</summary>
10
- <description>&lt;p&gt;This Facebook Conversion Code extension allows you to quickly implement Facebook tracking pixels for website visits and conversions (purchases) within your Magento store. &lt;a href="http://www.cadence-labs.com/2015/03/free-magento-mail-chimp-popup-extention/" title="User Manual"&gt;&lt;strong&gt;Learn how it works.&lt;/strong&gt;&lt;/a&gt;. &lt;/p&gt;&#xD;
11
- &lt;p&gt;You may set pixel ids for:&lt;/p&gt;&#xD;
12
- &lt;ul&gt;&#xD;
13
- &lt;li&gt;Facebook Visitor Pixel (code is displayed on every page)&lt;/li&gt;&#xD;
14
- &lt;li&gt;Facebook Conversion Pixel (code is displayed only upon successful checkout)&lt;/li&gt;&#xD;
15
- &lt;/ul&gt; &#xD;
16
  &lt;p&gt;Click here to view the official&#xD;
17
  &lt;a href="http://www.cadence-labs.com/2015/03/free-magento-mail-chimp-popup-extention/" title="User Manual"&gt;Facebook Tracking &amp;amp; Conversion Code User Guide&lt;/a&gt; with detailed step-by-step instructions. &lt;/p&gt;&#xD;
18
  &lt;h2&gt;Tracks Currency &amp;amp; Grand Total&lt;/h2&gt;&#xD;
@@ -21,10 +16,10 @@
21
  &lt;h2&gt;About The Developer&lt;/h2&gt;&#xD;
22
  &lt;p&gt;&lt;a href="http://www.cadence-labs.com/" title="Cadence Labs"&gt;Cadence Labs&lt;/a&gt; is a digital marketing, design, and Magento agency based in Boulder, Colorado. Our developers are Magento certified eCommerce geeks!&lt;/p&gt;</description>
23
  <notes>Tested on 1.9</notes>
24
- <authors><author><name>Cadence Labs</name><user>cadencelabs</user><email>alan@cadence-labs.com</email></author></authors>
25
- <date>2015-06-26</date>
26
- <time>22:07:30</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="188bfafe1689a7b3963dfa2b32993e8d"/></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="7db4331e1b927e1c117b31f74721c522"/></dir><dir name="template"><dir name="cadence"><dir name="fbpixel"><file name="conversion.phtml" hash="a514bb20e86a29fa5179f4c6760a0f78"/><file name="visitor.phtml" hash="8a508b8f1ef444405d4bbc6ad8c6c9bf"/></dir></dir></dir></dir></dir></dir></target></contents>
28
  <compatible/>
29
- <dependencies><required><php><min>5.2.0</min><max>5.6.0</max></php></required></dependencies>
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>&lt;p&gt;This Facebook Conversion Code extension allows you to quickly implement visitor and purchase events through the new Facebook Pixel. &lt;a href="http://www.cadence-labs.com/2015/03/free-magento-mail-chimp-popup-extention/" title="User Manual"&gt;&lt;strong&gt;Learn how it works.&lt;/strong&gt;&lt;/a&gt;. &lt;/p&gt;&#xD;
 
 
 
 
 
11
  &lt;p&gt;Click here to view the official&#xD;
12
  &lt;a href="http://www.cadence-labs.com/2015/03/free-magento-mail-chimp-popup-extention/" title="User Manual"&gt;Facebook Tracking &amp;amp; Conversion Code User Guide&lt;/a&gt; with detailed step-by-step instructions. &lt;/p&gt;&#xD;
13
  &lt;h2&gt;Tracks Currency &amp;amp; Grand Total&lt;/h2&gt;&#xD;
16
  &lt;h2&gt;About The Developer&lt;/h2&gt;&#xD;
17
  &lt;p&gt;&lt;a href="http://www.cadence-labs.com/" title="Cadence Labs"&gt;Cadence Labs&lt;/a&gt; is a digital marketing, design, and Magento agency based in Boulder, Colorado. Our developers are Magento certified eCommerce geeks!&lt;/p&gt;</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>