Aromicon_Google_Universal_Analytics - Version 1.0.1

Version Notes

Going stable

Download this release

Release Info

Developer Stefan Richter
Extension Aromicon_Google_Universal_Analytics
Version 1.0.1
Comparing to
See all releases


Version 1.0.1

app/code/community/Aromicon/Gua/Block/Gua.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package
4
+ * @author Stefan richter (richter@aromicon.com)
5
+ * @license aromicon gmbh 2013
6
+ */
7
+ class Aromicon_Gua_Block_Gua extends Mage_Core_Block_Template
8
+ {
9
+ protected function _getAccountId()
10
+ {
11
+ return Mage::getStoreConfig('aromicon_gua/general/account_id');
12
+ }
13
+
14
+ protected function _isAnonymizeIp()
15
+ {
16
+ return Mage::getStoreConfigFlag('aromicon_gua/general/anonymize_ip') ? 'true' : 'false';
17
+ }
18
+
19
+ public function isActive()
20
+ {
21
+ if(Mage::getStoreConfigFlag('aromicon_gua/general/enable')
22
+ && Mage::getStoreConfig('aromicon_gua/general/add_to') == $this->getParentBlock()->getNameInLayout()){
23
+ return true;
24
+ }
25
+ return false;
26
+ }
27
+
28
+ public function _isEcommerce()
29
+ {
30
+ Mage::log($this->getRequest()->getPathInfo());
31
+ if(Mage::getStoreConfigFlag('aromicon_gua/ecommerce/enable')
32
+ && $this->getRequest()->getPathInfo() == '/checkout/onepage/success/'){
33
+ return true;
34
+ }
35
+ return false;
36
+ }
37
+
38
+ public function getOrder()
39
+ {
40
+ $orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
41
+ return Mage::getModel('sales/order')->load($orderId);
42
+ }
43
+
44
+ public function getTransactionIdField()
45
+ {
46
+ return Mage::getStoreConfig('aromicon_gua/ecommerce/transaction_id') != false ? Mage::getStoreConfig('aromicon_gua/ecommerce/transaction_id') : 'entity_id';
47
+ }
48
+
49
+
50
+
51
+
52
+ }
app/code/community/Aromicon/Gua/Helper/Data.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package
4
+ * @author Stefan richter (richter@aromicon.com)
5
+ * @license aromicon gmbh 2013
6
+ */
7
+ class Aromicon_Gua_Helper_Data extends Mage_Core_Helper_Abstract {
8
+
9
+ }
app/code/community/Aromicon/Gua/Model/System/Config/Source/Addto.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package
4
+ * @author Stefan richter (richter@aromicon.com)
5
+ * @license aromicon gmbh 2013
6
+ */
7
+ class Aromicon_Gua_Model_System_Config_Source_Addto
8
+ {
9
+ public function toOptionArray()
10
+ {
11
+ return array(
12
+ array('value' => 'head', 'label'=>Mage::helper('aromicon_gua')->__('Head')),
13
+ array('value' => 'before_body_end', 'label'=>Mage::helper('aromicon_gua')->__('Before Body End')),
14
+ );
15
+ }
16
+ }
app/code/community/Aromicon/Gua/Model/System/Config/Source/Orderid.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package
4
+ * @author Stefan richter (richter@aromicon.com)
5
+ * @license aromicon gmbh 2013
6
+ */
7
+ class Aromicon_Gua_Model_System_Config_Source_Orderid
8
+ {
9
+ public function toOptionArray()
10
+ {
11
+ return array(
12
+ array('value' => 'entity_id', 'label'=>Mage::helper('aromicon_gua')->__('ID')),
13
+ array('value' => 'increment_id', 'label'=>Mage::helper('aromicon_gua')->__('Increment ID')),
14
+ );
15
+ }
16
+ }
app/code/community/Aromicon/Gua/etc/config.xml ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Aromicon_Gua>
5
+ <version>1.0.1</version>
6
+ </Aromicon_Gua>
7
+ </modules>
8
+ <global>
9
+ <models>
10
+ <aromicon_gua>
11
+ <class>Aromicon_Gua_Model</class>
12
+ </aromicon_gua>
13
+ </models>
14
+ <blocks>
15
+ <aromicon_gua>
16
+ <class>Aromicon_Gua_Block</class>
17
+ </aromicon_gua>
18
+ </blocks>
19
+ <helpers>
20
+ <aromicon_gua>
21
+ <class>Aromicon_Gua_Helper</class>
22
+ </aromicon_gua>
23
+ </helpers>
24
+ <resources>
25
+ <aromicon_gua_setup>
26
+ <setup>
27
+ <module>Aromicon_Gua</module>
28
+ </setup>
29
+ </aromicon_gua_setup>
30
+ </resources>
31
+ </global>
32
+ <frontend>
33
+ <layout>
34
+ <updates>
35
+ <aromicon_gua>
36
+ <file>aromicon_gua.xml</file>
37
+ </aromicon_gua>
38
+ </updates>
39
+ </layout>
40
+ </frontend>
41
+ <adminhtml>
42
+ <acl>
43
+ <resources>
44
+ <admin>
45
+ <children>
46
+ <system>
47
+ <children>
48
+ <config>
49
+ <children>
50
+ <aromicon_gua>
51
+ <title>Aromicon Google Universal Analytics Config Section</title>
52
+ </aromicon_gua>
53
+ </children>
54
+ </config>
55
+ </children>
56
+ </system>
57
+ </children>
58
+ </admin>
59
+ </resources>
60
+ </acl>
61
+ </adminhtml>
62
+ <default>
63
+ <aromicon_gua>
64
+ <ecommerce>
65
+ <transaction_id>id</transaction_id>
66
+ </ecommerce>
67
+ </aromicon_gua>
68
+ </default>
69
+ </config>
app/code/community/Aromicon/Gua/etc/system.xml ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <tabs>
4
+ <aromicon translate="label" module="aromicon_gua">
5
+ <label>Aromicon</label>
6
+ <sort_order>1</sort_order>
7
+ </aromicon>
8
+ </tabs>
9
+ <sections>
10
+ <aromicon_gua module="aromicon_gua">
11
+ <label>Google Universal Analytics</label>
12
+ <tab>aromicon</tab>
13
+ <sort_order>100</sort_order>
14
+ <show_in_default>1</show_in_default>
15
+ <show_in_website>1</show_in_website>
16
+ <show_in_store>1</show_in_store>
17
+ <groups>
18
+ <general translate="label" module="aromicon_gua">
19
+ <label>General</label>
20
+ <frontend_type>text</frontend_type>
21
+ <sort_order>10</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>1</show_in_store>
25
+ <comment></comment>
26
+ <fields>
27
+ <enable>
28
+ <label>Enable</label>
29
+ <frontend_type>select</frontend_type>
30
+ <source_model>adminhtml/system_config_source_yesno</source_model>
31
+ <sort_order>10</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ </enable>
36
+ <add_to>
37
+ <label>Script Position</label>
38
+ <frontend_type>select</frontend_type>
39
+ <source_model>aromicon_gua/system_config_source_addto</source_model>
40
+ <sort_order>20</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>1</show_in_store>
44
+ <comment></comment>
45
+ </add_to>
46
+ <account_id>
47
+ <label>Account Id</label>
48
+ <frontend_type>text</frontend_type>
49
+ <sort_order>30</sort_order>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>1</show_in_website>
52
+ <show_in_store>1</show_in_store>
53
+ <comment></comment>
54
+ </account_id>
55
+ <anonymize_ip>
56
+ <label>Anonymize Ip</label>
57
+ <frontend_type>select</frontend_type>
58
+ <source_model>adminhtml/system_config_source_yesno</source_model>
59
+ <sort_order>10</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>1</show_in_store>
63
+ </anonymize_ip>
64
+ </fields>
65
+ </general>
66
+ <ecommerce translate="label" module="aromicon_gua">
67
+ <label>e-Commerce</label>
68
+ <frontend_type>text</frontend_type>
69
+ <sort_order>20</sort_order>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>1</show_in_store>
73
+ <comment>Here you can enable e-Commerce Tracking for Google Universal Analytics. Tracking Code is added to Success Page.</comment>
74
+ <fields>
75
+ <enable>
76
+ <label>Enable</label>
77
+ <frontend_type>select</frontend_type>
78
+ <source_model>adminhtml/system_config_source_yesno</source_model>
79
+ <sort_order>10</sort_order>
80
+ <show_in_default>1</show_in_default>
81
+ <show_in_website>1</show_in_website>
82
+ <show_in_store>1</show_in_store>
83
+ </enable>
84
+ <transaction_id>
85
+ <label>Transaction Id</label>
86
+ <frontend_type>select</frontend_type>
87
+ <source_model>aromicon_gua/system_config_source_orderid</source_model>
88
+ <sort_order>20</sort_order>
89
+ <show_in_default>1</show_in_default>
90
+ <show_in_website>1</show_in_website>
91
+ <show_in_store>1</show_in_store>
92
+ </transaction_id>
93
+ </fields>
94
+ </ecommerce>
95
+ </groups>
96
+ </aromicon_gua>
97
+ </sections>
98
+ </config>
app/code/community/Aromicon/Gua/sql/aromicon_gua_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package
4
+ * @author Stefan richter (richter@aromicon.com)
5
+ * @license aromicon gmbh 2013
6
+ */
7
+ /* @var $installer Mage_Core_Model_Resource_Setup */
8
+ $installer = $this;
9
+
10
+ $installer->startSetup();
11
+
12
+
13
+
14
+ $installer->endSetup();
app/design/frontend/base/default/layout/aromicon_gua.xml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <block type="aromicon_gua/gua" name="google_universial_analytics" template="aromicon/gua/gua.phtml" />
6
+ </reference>
7
+ <reference name="before_body_end">
8
+ <block type="aromicon_gua/gua" name="google_universial_analytics" template="aromicon/gua/gua.phtml" />
9
+ </reference>
10
+ </default>
11
+ </layout>
app/etc/modules/Aromicon_Gua.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Aromicon_Gua>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Aromicon_Gua>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Aromicon_Google_Universal_Analytics</name>
4
+ <version>1.0.1</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.aromicon.de/magento-download-extensions-modules/de/license">COMMERCIAL SOFTWARE LICENSE (v1.0)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Adds new Google Universal Analytics to Magento Store.</summary>
10
+ <description>Adds new Google Universal Analytics to Magento Store.</description>
11
+ <notes>Going stable</notes>
12
+ <authors><author><name>Stefan Richter</name><user>aromicon_de</user><email>kontakt@aromicon.com</email></author></authors>
13
+ <date>2013-06-26</date>
14
+ <time>10:18:53</time>
15
+ <contents><target name="mage"><dir name="app"><dir name="code"><dir name="community"><dir name="Aromicon"><dir name="Gua"><dir><dir name="Block"><file name="Gua.php" hash="988cfee0ffe6b681435e11f913bdceea"/></dir><dir name="Helper"><file name="Data.php" hash="892999bec44a25b0e58c9e00373c0d7d"/></dir><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="Addto.php" hash="14d18fae25ecee83c1a5e872c33db83b"/><file name="Orderid.php" hash="90fcb94f06e986d19cc0c050f655d0c0"/></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="e749ec6457d1aaddc9e7cb38ec61dc35"/><file name="system.xml" hash="2c8c2425e79e2d15ea1f4028220aa337"/></dir><dir name="sql"><dir name="aromicon_gua_setup"><file name="mysql4-install-1.0.0.php" hash="4bbce7f9d21a131d0aefc73156c87e36"/></dir></dir></dir></dir></dir></dir></dir><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="aromicon"><file name="gua" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir><dir name="layout"><file name="aromicon_gua.xml" hash="884de73b75c9e8ff9144dbf7b936225e"/></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Aromicon_Gua.xml" hash="cbaa405a82a74fe32c6821e3342a3b7d"/></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
18
+ </package>