Version Notes
Soap Roi Tracker
Download this release
Release Info
| Developer | Soap Media |
| Extension | SOAP_ShoppingAnalytics |
| Version | 1.1.0 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.0 to 1.1.0
- app/code/local/SOAP/ShoppingAnalytics/Block/Sa.php +35 -4
- app/code/local/SOAP/ShoppingAnalytics/Helper/Data.php +9 -0
- app/code/local/SOAP/ShoppingAnalytics/etc/config.xml +1 -1
- app/code/local/SOAP/ShoppingAnalytics/etc/system.xml +35 -0
- app/design/frontend/base/default/template/shoppinganalytics/sa.phtml +2 -2
- package.xml +4 -4
app/code/local/SOAP/ShoppingAnalytics/Block/Sa.php
CHANGED
|
@@ -140,23 +140,54 @@ var google_conversion_label = "'.$label.'";
|
|
| 140 |
conversion/'.$id.'/?value='.$value.'
|
| 141 |
&label='.$label.'&script=0">
|
| 142 |
</noscript>
|
| 143 |
-
<!-- END Google Tracking Code -->
|
|
|
|
| 144 |
}
|
| 145 |
}
|
| 146 |
}
|
| 147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
protected function _toHtml()
|
| 149 |
{
|
| 150 |
-
|
|
|
|
|
|
|
| 151 |
return '';
|
| 152 |
}
|
| 153 |
elseif (Mage::helper('shoppinganalytics')->isShoppingAnalyticsAvailable())
|
| 154 |
{
|
| 155 |
-
|
| 156 |
}
|
| 157 |
elseif (Mage::helper('shoppinganalytics')->isGoogleTrackingAvailable()) {
|
| 158 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
}
|
|
|
|
|
|
|
| 160 |
}
|
| 161 |
}
|
| 162 |
|
| 140 |
conversion/'.$id.'/?value='.$value.'
|
| 141 |
&label='.$label.'&script=0">
|
| 142 |
</noscript>
|
| 143 |
+
<!-- END Google Tracking Code -->
|
| 144 |
+
';
|
| 145 |
}
|
| 146 |
}
|
| 147 |
}
|
| 148 |
|
| 149 |
+
protected function _addMicrosoftTrackingCode() {
|
| 150 |
+
$domainid = Mage::getStoreConfig('shopping/mstracking/domain');
|
| 151 |
+
$cp = Mage::getStoreConfig('shopping/mstracking/cp');
|
| 152 |
+
return '
|
| 153 |
+
<!-- Microsoft adCenter Tracking -->
|
| 154 |
+
<SCRIPT>
|
| 155 |
+
microsoft_adcenterconversion_domainid = '.$domainid.';
|
| 156 |
+
microsoft_adcenterconversion_cp = '.$cp.';
|
| 157 |
+
microsoft_adcenterconversionparams = new Array();
|
| 158 |
+
microsoft_adcenterconversionparams[0] = "dedup=1";
|
| 159 |
+
</SCRIPT>
|
| 160 |
+
<SCRIPT SRC="https://0.r.msn.com/scripts/microsoft_adcenterconversion.js"></SCRIPT>
|
| 161 |
+
<NOSCRIPT>
|
| 162 |
+
<IMG width=1 height=1 SRC="https://'.$domainid.'.r.msn.com/?type=1&cp=1&dedup=1"/>
|
| 163 |
+
</NOSCRIPT>
|
| 164 |
+
<a href="http://advertising.msn.com/MSNadCenter/LearningCenter/adtracking.asp" target="_blank">::adCenter::</a>
|
| 165 |
+
<!-- END Microsoft adCenter Tracking -->
|
| 166 |
+
|
| 167 |
+
';
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
protected function _toHtml()
|
| 171 |
{
|
| 172 |
+
$output = '';
|
| 173 |
+
if (!Mage::helper('shoppinganalytics')->isShoppingAnalyticsAvailable() && !Mage::helper('shoppinganalytics')->isGoogleTrackingAvailable()
|
| 174 |
+
&& !Mage::helper('shoppinganalytics')->isMicrosoftTrackingAvailable()) {
|
| 175 |
return '';
|
| 176 |
}
|
| 177 |
elseif (Mage::helper('shoppinganalytics')->isShoppingAnalyticsAvailable())
|
| 178 |
{
|
| 179 |
+
$output .= parent::_toHtml();
|
| 180 |
}
|
| 181 |
elseif (Mage::helper('shoppinganalytics')->isGoogleTrackingAvailable()) {
|
| 182 |
+
$output .= $this->_addGoogleTrackingCode();
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
if ((Mage::helper('shoppinganalytics')->isMicrosoftTrackingAvailable()))
|
| 186 |
+
{
|
| 187 |
+
$output .= $this->_addMicrosoftTrackingCode();
|
| 188 |
}
|
| 189 |
+
|
| 190 |
+
return $output;
|
| 191 |
}
|
| 192 |
}
|
| 193 |
|
app/code/local/SOAP/ShoppingAnalytics/Helper/Data.php
CHANGED
|
@@ -29,6 +29,9 @@ class SOAP_ShoppingAnalytics_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 29 |
|
| 30 |
const XML_PATH_TRACKING_ACTIVE = 'shopping/tracking/active';
|
| 31 |
const XML_PATH_TRACKING_ACCOUNT = 'shopping/tracking/account';
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
public function isShoppingAnalyticsAvailable($store = null)
|
| 34 |
{
|
|
@@ -41,4 +44,10 @@ class SOAP_ShoppingAnalytics_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 41 |
$accountId = Mage::getStoreConfig(self::XML_PATH_TRACKING_ACCOUNT, $store);
|
| 42 |
return $accountId && Mage::getStoreConfigFlag(self::XML_PATH_TRACKING_ACTIVE, $store);
|
| 43 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
}
|
| 29 |
|
| 30 |
const XML_PATH_TRACKING_ACTIVE = 'shopping/tracking/active';
|
| 31 |
const XML_PATH_TRACKING_ACCOUNT = 'shopping/tracking/account';
|
| 32 |
+
|
| 33 |
+
const XML_PATH_MSTRACKING_ACTIVE = 'shopping/mstracking/active';
|
| 34 |
+
const XML_PATH_MSTRACKING_ACCOUNT = 'shopping/mstracking/domain';
|
| 35 |
|
| 36 |
public function isShoppingAnalyticsAvailable($store = null)
|
| 37 |
{
|
| 44 |
$accountId = Mage::getStoreConfig(self::XML_PATH_TRACKING_ACCOUNT, $store);
|
| 45 |
return $accountId && Mage::getStoreConfigFlag(self::XML_PATH_TRACKING_ACTIVE, $store);
|
| 46 |
}
|
| 47 |
+
|
| 48 |
+
public function isMicrosoftTrackingAvailable($store = null)
|
| 49 |
+
{
|
| 50 |
+
$accountId = Mage::getStoreConfig(self::XML_PATH_MSTRACKING_ACCOUNT, $store);
|
| 51 |
+
return $accountId && Mage::getStoreConfigFlag(self::XML_PATH_MSTRACKING_ACTIVE, $store);
|
| 52 |
+
}
|
| 53 |
}
|
app/code/local/SOAP/ShoppingAnalytics/etc/config.xml
CHANGED
|
@@ -19,7 +19,7 @@
|
|
| 19 |
<config>
|
| 20 |
<modules>
|
| 21 |
<SOAP_ShoppingAnalytics>
|
| 22 |
-
<version>1.
|
| 23 |
</SOAP_ShoppingAnalytics>
|
| 24 |
</modules>
|
| 25 |
<global>
|
| 19 |
<config>
|
| 20 |
<modules>
|
| 21 |
<SOAP_ShoppingAnalytics>
|
| 22 |
+
<version>1.1</version>
|
| 23 |
</SOAP_ShoppingAnalytics>
|
| 24 |
</modules>
|
| 25 |
<global>
|
app/code/local/SOAP/ShoppingAnalytics/etc/system.xml
CHANGED
|
@@ -127,6 +127,41 @@
|
|
| 127 |
</colour>
|
| 128 |
</fields>
|
| 129 |
</tracking>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
</groups>
|
| 131 |
</shopping>
|
| 132 |
</sections>
|
| 127 |
</colour>
|
| 128 |
</fields>
|
| 129 |
</tracking>
|
| 130 |
+
<mstracking translate="label">
|
| 131 |
+
<label>Microsoft adCenter Tracking</label>
|
| 132 |
+
<frontend_type>text</frontend_type>
|
| 133 |
+
<sort_order>20</sort_order>
|
| 134 |
+
<show_in_default>1</show_in_default>
|
| 135 |
+
<show_in_website>1</show_in_website>
|
| 136 |
+
<show_in_store>1</show_in_store>
|
| 137 |
+
<fields>
|
| 138 |
+
<active translate="label">
|
| 139 |
+
<label>Enabled</label>
|
| 140 |
+
<frontend_type>select</frontend_type>
|
| 141 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 142 |
+
<sort_order>10</sort_order>
|
| 143 |
+
<show_in_default>1</show_in_default>
|
| 144 |
+
<show_in_website>1</show_in_website>
|
| 145 |
+
<show_in_store>1</show_in_store>
|
| 146 |
+
</active>
|
| 147 |
+
<domain translate="label">
|
| 148 |
+
<label>Domain ID</label>
|
| 149 |
+
<frontend_type>text</frontend_type>
|
| 150 |
+
<sort_order>20</sort_order>
|
| 151 |
+
<show_in_default>1</show_in_default>
|
| 152 |
+
<show_in_website>1</show_in_website>
|
| 153 |
+
<show_in_store>1</show_in_store>
|
| 154 |
+
</domain>
|
| 155 |
+
<cp translate="label">
|
| 156 |
+
<label>CP: </label>
|
| 157 |
+
<frontend_type>text</frontend_type>
|
| 158 |
+
<sort_order>25</sort_order>
|
| 159 |
+
<show_in_default>1</show_in_default>
|
| 160 |
+
<show_in_website>1</show_in_website>
|
| 161 |
+
<show_in_store>1</show_in_store>
|
| 162 |
+
</cp>
|
| 163 |
+
</fields>
|
| 164 |
+
</mstracking>
|
| 165 |
</groups>
|
| 166 |
</shopping>
|
| 167 |
</sections>
|
app/design/frontend/base/default/template/shoppinganalytics/sa.phtml
CHANGED
|
@@ -15,7 +15,7 @@
|
|
| 15 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
| 16 |
*/
|
| 17 |
?>
|
| 18 |
-
<?php if (!Mage::helper('core/cookie')->isUserNotAllowSaveCookie()): ?>
|
| 19 |
<?php $accountId = Mage::getStoreConfig(SOAP_ShoppingAnalytics_Helper_Data::XML_PATH_SHOPPING_ACCOUNT) ?>
|
| 20 |
|
| 21 |
<!-- BEGIN SHOPPING ROI CODE -->
|
|
@@ -30,4 +30,4 @@
|
|
| 30 |
|
| 31 |
<?php echo $this->_addGoogleTrackingCode() ?>
|
| 32 |
|
| 33 |
-
<?php endif; ?>
|
| 15 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
| 16 |
*/
|
| 17 |
?>
|
| 18 |
+
<?php //if (!Mage::helper('core/cookie')->isUserNotAllowSaveCookie()): ?>
|
| 19 |
<?php $accountId = Mage::getStoreConfig(SOAP_ShoppingAnalytics_Helper_Data::XML_PATH_SHOPPING_ACCOUNT) ?>
|
| 20 |
|
| 21 |
<!-- BEGIN SHOPPING ROI CODE -->
|
| 30 |
|
| 31 |
<?php echo $this->_addGoogleTrackingCode() ?>
|
| 32 |
|
| 33 |
+
<?php //endif; ?>
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>SOAP_ShoppingAnalytics</name>
|
| 4 |
-
<version>1.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://www.gnu.org/licenses/gpl.html">GNU General Public License</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -15,9 +15,9 @@ The Magento ROI Tracker enables the option to easily manage Adwords conversion t
|
|
| 15 |
To keep up to date follow the our <a href="http://www.soapmedia.co.uk/magento-roi-tracking-extension/">Mangeto ROI Tracking</a> post on our blog</description>
|
| 16 |
<notes>Soap Roi Tracker</notes>
|
| 17 |
<authors><author><name>Soap Media</name><user>toocanx</user><email>adam@soapmedia.co.uk</email></author></authors>
|
| 18 |
-
<date>2012-10-
|
| 19 |
-
<time>
|
| 20 |
-
<contents><target name="magelocal"><dir><dir name="SOAP"><dir><dir name="ShoppingAnalytics"><dir name="Block"><file name="Hint.php" hash="072d7b20b293ac5bc8352221c095820b"/><file name="Sa.php" hash="
|
| 21 |
<compatible/>
|
| 22 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
| 23 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>SOAP_ShoppingAnalytics</name>
|
| 4 |
+
<version>1.1.0</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://www.gnu.org/licenses/gpl.html">GNU General Public License</license>
|
| 7 |
<channel>community</channel>
|
| 15 |
To keep up to date follow the our <a href="http://www.soapmedia.co.uk/magento-roi-tracking-extension/">Mangeto ROI Tracking</a> post on our blog</description>
|
| 16 |
<notes>Soap Roi Tracker</notes>
|
| 17 |
<authors><author><name>Soap Media</name><user>toocanx</user><email>adam@soapmedia.co.uk</email></author></authors>
|
| 18 |
+
<date>2012-10-29</date>
|
| 19 |
+
<time>14:09:42</time>
|
| 20 |
+
<contents><target name="magelocal"><dir><dir name="SOAP"><dir><dir name="ShoppingAnalytics"><dir name="Block"><file name="Hint.php" hash="072d7b20b293ac5bc8352221c095820b"/><file name="Sa.php" hash="489b4ac8b0092519f181bcc62bd08eb8"/></dir><dir name="Helper"><file name="Data.php" hash="625b11a774060b1189dfde4f6385add7"/></dir><dir name="Model"><file name="Observer.php" hash="bcb871edd134be8e1ed0a37cfbae96a9"/></dir><dir name="etc"><file name="adminhtml.xml" hash="da2d3619541c4df47c925d3921a62847"/><file name="config.xml" hash="b5897332867f8aa7c104996760c47bc1"/><file name="system.xml" hash="8d959c2c15b607ccced8cc9cc51d9819"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="shoppinganalytics"><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="685eedf009fc1494fd266ca93a27923a"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="shoppinganalytics.xml" hash="287589c95687eb245f78ab95b6492093"/></dir><dir name="template"><dir name="shoppinganalytics"><file name="sa.phtml" hash="56d272a9fc9e71038f7455aae1a126f4"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="SOAP_ShoppingAnalyics.xml" hash="356026928a86b699d9a6ff759b43f617"/></dir></dir></target></contents>
|
| 21 |
<compatible/>
|
| 22 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
| 23 |
</package>
|
