Fenomics_GTM - Version 1.0.0

Version Notes

Latest version

Download this release

Release Info

Developer FENOMICS GmbH
Extension Fenomics_GTM
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/local/Fenomics/GTM/Block/Gtmcode.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * FENOMICS extension for Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * Do not edit or add to this file if you wish to upgrade
15
+ * the Fenomics GTM module to newer versions in the future.
16
+ * If you wish to customize the Fenomics GTM module for your needs
17
+ * please refer to http://www.magentocommerce.com for more information.
18
+ *
19
+ * @category Fenomics
20
+ * @package Fenomics_GTM
21
+ * @copyright Copyright (C) 2014 FENOMICS GmbH (http://www.fenomics.de/)
22
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
23
+ */
24
+
25
+ /**
26
+ * @category Fenomics
27
+ * @package Fenomics_GTM
28
+ * @subpackage Block
29
+ * @author Wolfgang Embach <w.embach@fenomics.de>
30
+ */
31
+ class Fenomics_GTM_Block_Gtmcode extends Mage_Core_Block_Template
32
+ {
33
+
34
+ protected function _getGTMId() {
35
+
36
+ // Get the container ID.
37
+ $Id = Mage::helper ( 'fenomics_gtm' )->getGTMId ();
38
+
39
+ // Return the container id.
40
+ return $Id;
41
+ }
42
+ protected function _toHtml() {
43
+
44
+ //
45
+ if (! Mage::helper ( 'fenomics_gtm' )->isGTMenabled ())
46
+ return '';
47
+ //
48
+ return parent::_toHtml ();
49
+ }
50
+
51
+ }
app/code/local/Fenomics/GTM/Helper/Data.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * FENOMICS extension for Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * DISCLAIMER
14
+ *
15
+ * Do not edit or add to this file if you wish to upgrade
16
+ * the Fenomics GTM module to newer versions in the future.
17
+ * If you wish to customize the Fenomics GTM module for your needs
18
+ * please refer to http://www.magentocommerce.com for more information.
19
+ *
20
+ * @category Fenomics
21
+ * @package Fenomics_GTM
22
+ * @copyright Copyright (C) 2014 FENOMICS GmbH (http://www.fenomics.de/)
23
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24
+ */
25
+
26
+ /**
27
+ *
28
+ * @category Fenomics
29
+ * @package Fenomics_GTM
30
+ * @subpackage Helper
31
+ * @author Wolfgang Embach <w.embach@fenomics.de>
32
+ */
33
+ class Fenomics_GTM_Helper_Data extends Mage_Core_Helper_Data
34
+ {
35
+
36
+ /**
37
+ *
38
+ * @return boolean
39
+ */
40
+ public function isGTMenabled()
41
+ {
42
+ $w = Mage::getStoreConfigFlag('gtm/customization/loadgtm');
43
+ return $w;
44
+ }
45
+
46
+ /**
47
+ *
48
+ * @return Ambigous <mixed, string, NULL, multitype:, multitype:Ambigous <string, multitype:, NULL> >
49
+ */
50
+ public function getGTMId()
51
+ {
52
+ $w = Mage::getStoreConfig('gtm/customization/idgtm');
53
+ return $w;
54
+ }
55
+ }
app/code/local/Fenomics/GTM/etc/adminhtml.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <gtm translate="title" module="fenomics_gtm">
12
+ <title>Fenomics GTM</title>
13
+ </gtm>
14
+ </children>
15
+ </config>
16
+ </children>
17
+ </system>
18
+ </children>
19
+ </admin>
20
+ </resources>
21
+ </acl>
22
+ </config>
app/code/local/Fenomics/GTM/etc/config.xml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * FENOMICS extension for Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * DISCLAIMER
14
+ *
15
+ * Do not edit or add to this file if you wish to upgrade
16
+ * the Fenomics GTM module to newer versions in the future.
17
+ * If you wish to customize the Fenomics GTM module for your needs
18
+ * please refer to http://www.magentocommerce.com for more information.
19
+ *
20
+ * @category Fenomics
21
+ * @package Fenomics_GTM
22
+ * @copyright Copyright (C) 2014 FENOMICS GmbH (http://www.fenomics.de/)
23
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24
+ */
25
+ -->
26
+ <config>
27
+ <modules>
28
+ <Fenomics_GTM>
29
+ <version>1.0.0</version>
30
+ </Fenomics_GTM>
31
+ </modules>
32
+ <global>
33
+ <blocks>
34
+ <fenomics_gtm>
35
+ <class>Fenomics_GTM_Block</class>
36
+ </fenomics_gtm>
37
+ </blocks>
38
+ <helpers>
39
+ <fenomics_gtm>
40
+ <class>Fenomics_GTM_Helper</class>
41
+ </fenomics_gtm>
42
+ </helpers>
43
+ </global>
44
+ <frontend>
45
+ <layout>
46
+ <updates>
47
+ <gtm>
48
+ <file>fenomics/gtm.xml</file>
49
+ </gtm>
50
+ </updates>
51
+ </layout>
52
+ </frontend>
53
+ <default>
54
+ <fenomics>
55
+ <customization>
56
+ <loadgtm>0</loadgtm>
57
+ </customization>
58
+ </fenomics>
59
+ </default>
60
+ </config>
61
+
app/code/local/Fenomics/GTM/etc/system.xml ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <fenomics translate="label" module="fenomics_gtm">
5
+ <label>Fenomics</label>
6
+ <sort_order>1</sort_order>
7
+ <class>fenomics</class>
8
+ </fenomics>
9
+ </tabs>
10
+ <sections>
11
+ <gtm translate="label" module="fenomics_gtm">
12
+ <tab>fenomics</tab>
13
+ <label>Google Tag Manager (GTM)</label>
14
+ <frontend_type>text</frontend_type>
15
+ <sort_order>10</sort_order>
16
+ <show_in_default>1</show_in_default>
17
+ <show_in_website>1</show_in_website>
18
+ <show_in_store>1</show_in_store>
19
+ <groups>
20
+ <customization translate="label">
21
+ <label>Benutzereinstellungen</label>
22
+ <frontend_type>text</frontend_type>
23
+ <sort_order>1000</sort_order>
24
+ <show_in_default>1</show_in_default>
25
+ <show_in_website>1</show_in_website>
26
+ <show_in_store>1</show_in_store>
27
+ <fields>
28
+ <loadgtm translate="label">
29
+ <label>Load GTM Script-Block</label>
30
+ <comment>
31
+ </comment>
32
+ <frontend_type>select</frontend_type>
33
+ <source_model>adminhtml/system_config_source_enabledisable
34
+ </source_model>
35
+ <sort_order>210</sort_order>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>1</show_in_store>
39
+ </loadgtm>
40
+ <idgtm translate="label">
41
+ <label>GTM-Id</label>
42
+ <frontend_type>text</frontend_type>
43
+ <sort_order>220</sort_order>
44
+ <show_in_default>1</show_in_default>
45
+ <show_in_website>1</show_in_website>
46
+ <show_in_store>1</show_in_store>
47
+ </idgtm>
48
+ </fields>
49
+ </customization>
50
+ </groups>
51
+ </gtm>
52
+ </sections>
53
+ </config>
app/design/frontend/base/default/layout/fenomics/gtm.xml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <layout version="0.1.0">
2
+ <default>
3
+ <reference name="after_body_start">
4
+ <block type="fenomics_gtm/gtmcode" name="google_tag_manager" as="google_tag_manager" template="fenomics/gtm/default.phtml" />
5
+ </reference>
6
+ </default>
7
+ </layout>
app/design/frontend/base/default/template/fenomics/gtm/default.phtml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $GTMId = $this->_getGTMId ();
3
+ ?>
4
+
5
+ <!-- Google Tag Manager -->
6
+ <noscript>
7
+ <iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXX" height="0"
8
+ width="0" style="display: none; visibility: hidden"></iframe>
9
+ </noscript>
10
+ <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
11
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
12
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
13
+ '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
14
+ })(window,document,'script','dataLayer','<?php echo $GTMId; ?>');</script>
15
+ <!-- End Google Tag Manager -->
app/etc/modules/Fenomics_GTM.xml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * FENOMICS extension for Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * DISCLAIMER
14
+ *
15
+ * Do not edit or add to this file if you wish to upgrade
16
+ * the Fenomics GTM module to newer versions in the future.
17
+ * If you wish to customize the Fenomics GTM module for your needs
18
+ * please refer to http://www.magentocommerce.com for more information.
19
+ *
20
+ * @category Fenomics
21
+ * @package Fenomics_GTM
22
+ * @copyright Copyright (C) 2014 FENOMICS GmbH (http://www.fenomics.de/)
23
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24
+ */
25
+ -->
26
+ <config>
27
+ <modules>
28
+ <Fenomics_GTM>
29
+ <active>true</active>
30
+ <codePool>local</codePool>
31
+ </Fenomics_GTM>
32
+ </modules>
33
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Fenomics_GTM</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Simple Google Tag Manager (GTM) Integration</summary>
10
+ <description>Simple Google Tag Manager (GTM) Integration. Made in Germany.</description>
11
+ <notes>Latest version</notes>
12
+ <authors><author><name>FENOMICS GmbH</name><user>we</user><email>w.embach@fenomics.de</email></author></authors>
13
+ <date>2014-08-21</date>
14
+ <time>12:06:17</time>
15
+ <contents><target name="magelocal"><dir name="Fenomics"><dir name="GTM"><dir name="Block"><file name="Gtmcode.php" hash="88a7f87717b0a86ca70b7f194076088d"/></dir><dir name="Helper"><file name="Data.php" hash="b62d88ce00ca36e751a6a98b4109668e"/></dir><dir name="etc"><file name="adminhtml.xml" hash="7fc7608e12fa0569744095e7e99c9ee9"/><file name="config.xml" hash="da242565fc42ec925951fabc35659540"/><file name="system.xml" hash="dfe54030618ec5368f98e9fe7794d3aa"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="fenomics"><file name="gtm.xml" hash="8d5d95229f74c900ea71e20d6edf0676"/></dir></dir><dir name="template"><dir name="fenomics"><dir name="gtm"><file name="default.phtml" hash="83f3b48f0dc88e61fda582eb6ce20f79"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Fenomics_GTM.xml" hash="8320d9814f7a78a34ee6e58e15dd43a3"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.3.0</min><max>5.5.0</max></php></required></dependencies>
18
+ </package>