One_Click_Google_Tag_Manager - Version 1.0.0

Version Notes

One click installation of Google Tag Manager ID within your store.

Download this release

Release Info

Developer wholesalesms
Extension One_Click_Google_Tag_Manager
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/Studio45/GoogleTagManager/Block/Gtm.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Studio45_GoogleTagManager_Block_Gtm extends Mage_Core_Block_Template
3
+ {
4
+ public function getIsHomePage()
5
+ {
6
+ $routeName = Mage::app()->getRequest()->getRouteName();
7
+ $identifier = Mage::getSingleton('cms/page')->getIdentifier();
8
+
9
+ if($routeName == 'cms' && $identifier == 'home') {
10
+ return true;
11
+ } else {
12
+ return false;
13
+ }
14
+ }
15
+
16
+ public function getIsOrderSuccessPage()
17
+ {
18
+ if (strpos(Mage::app()->getRequest()->getPathInfo(), '/checkout/onepage/success') !== false) {
19
+ return true;
20
+ }
21
+ return false;
22
+ }
23
+ }
24
+ ?>
app/code/community/Studio45/GoogleTagManager/Block/System/Config/Info.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Studio45_GoogleTagManager_Block_System_config_Info
3
+ extends Mage_adminhtml_Block_Abstract
4
+ implements Varien_Data_Form_Element_Rendere_Interface
5
+ {
6
+ public function render(Varien_Data_Form_Element_Abstract $element)
7
+ {
8
+ $html = ' ';
9
+
10
+ return $html;
11
+ }
12
+ }
13
+
14
+ ?>
app/code/community/Studio45/GoogleTagManager/Controllers/IndexController.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Studio45_GoogleTagManager_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function getCustomerSession()
5
+ {
6
+ return Mage::getSingleton('customer/session');
7
+ }
8
+
9
+ public function getCoreSession()
10
+ {
11
+ return Mage::getSingleton('core/session');
12
+ }
13
+ }
14
+ ?>
app/code/community/Studio45/GoogleTagManager/Helper/Data.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Studio45_GoogleTagManager_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+ const CONFIG_GTM_GENERAL_IS_ENABLE = 'googletagmanager/general/is_enable';
6
+ const CONFIG_GTM_GENERAL_CONTAINER_ID = 'googletagmanager/general/container_id';
7
+
8
+ public function getContainerId()
9
+ {
10
+ return Mage::getStoreConfig(self::CONFIG_GTM_GENERAL_CONTAINER_ID);
11
+ }
12
+
13
+ public function getIsEnable()
14
+ {
15
+ return Mage::getStoreConfig(self::CONFIG_GTM_GENERAL_IS_ENABLE);
16
+ }
17
+ }
18
+
19
+ ?>
app/code/community/Studio45/GoogleTagManager/Model/Gtm.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ class Studio45_GoogleTagManager_Model_Gtm extends Mage_Core_Model_Abstrack
3
+ {
4
+
5
+ }
6
+ ?>
app/code/community/Studio45/GoogleTagManager/etc/adminhtml.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <all>
6
+ <title>Allow Everything</title>
7
+ </all>
8
+ <admin>
9
+ <children>
10
+ <system>
11
+ <children>
12
+ <config>
13
+ <children>
14
+ <googletagmanager>
15
+ <title>GoogleTagManager</title>
16
+ </googletagmanager>
17
+ </children>
18
+ </config>
19
+ </children>
20
+ </system>
21
+ </children>
22
+ </admin>
23
+ </resources>
24
+ </acl>
25
+ </config>
app/code/community/Studio45/GoogleTagManager/etc/config.xml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Studio45_GoogleTagManager>
5
+ <version>0.1.0</version>
6
+ </Studio45_GoogleTagManager>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <googletagmanager>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Studio45_GoogleTagManager</module>
14
+ <frontName>googletagmanager</frontName>
15
+ </args>
16
+ </googletagmanager>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <googletagmanager>
21
+ <file>studio45/googletagmanager.xml</file>
22
+ </googletagmanager>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <admin>
27
+ <routers>
28
+ <googletagmanageradmin>
29
+ <use>admin</use>
30
+ <args>
31
+ <module>Studio45_GoogleTagManager</module>
32
+ <frontName>googletagmanageradmin</frontName>
33
+ </args>
34
+ </googletagmanageradmin>
35
+ </routers>
36
+ </admin>
37
+ <global>
38
+ <models>
39
+ <googletagmanager>
40
+ <class>Studio45_GoogleTagManager_Model</class>
41
+ </googletagmanager>
42
+ </models>
43
+ <blocks>
44
+ <googletagmanager>
45
+ <class>Studio45_GoogleTagManager_Block</class>
46
+ </googletagmanager>
47
+ </blocks>
48
+ <helpers>
49
+ <googletagmanager>
50
+ <class>Studio45_GoogleTagManager_Helper</class>
51
+ </googletagmanager>
52
+ </helpers>
53
+ </global>
54
+ </config>
app/code/community/Studio45/GoogleTagManager/etc/system.xml ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <tabs>
4
+ <studio45all translate="label" module="googletagmanager">
5
+ <label>Studio45 Extensions</label>
6
+ <sort_order>250</sort_order>
7
+ </studio45all>
8
+ </tabs>
9
+ <sections>
10
+ <googletagmanager module="googletagmanager">
11
+ <label>Google Tag Manager</label>
12
+ <tab>studio45all</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>100</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <general translate="label">
20
+ <label>General Settings</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>20</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <is_enable translate="label comment">
28
+ <label>Enable</label>
29
+ <!-- <comment>Enable/Disable Google Tag Manager</comment> -->
30
+ <frontend_type>select</frontend_type>
31
+ <source_model>adminhtml/system_config_source_yesno</source_model>
32
+ <sort_order>10</sort_order>
33
+ <show_in_default>1</show_in_default>
34
+ <show_in_website>1</show_in_website>
35
+ <show_in_store>1</show_in_store>
36
+ </is_enable>
37
+ <container_id translate="label comment">
38
+ <label>Container ID</label>
39
+ <comment>Enter Your GTM ID</comment>
40
+ <frontend_type>text</frontend_type>
41
+ <sort_order>20</sort_order>
42
+ <show_in_default>1</show_in_default>
43
+ <show_in_website>1</show_in_website>
44
+ <show_in_store>1</show_in_store>
45
+ </container_id>
46
+ </fields>
47
+ </general>
48
+ </groups>
49
+ </googletagmanager>
50
+ </sections>
51
+ </config>
app/design/frontend/base/default/layout/studio45/googletagmanager.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="after_body_start" before="-">
5
+ <block type="googletagmanager/gtm" name="studio45_google_tag_manager" as="studio45_google_tag manager" template="studio45/googletagmanager/gtm.phtml"/>
6
+ </reference>
7
+ </default>
8
+ </layout>
app/design/frontend/base/default/template/studio45/googletagmanager/gtm.phtml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $_helper = $this->helper('googletagmanager');
4
+ $_containerId = trim($_helper->getContainerId());
5
+ if ($_helper->getIsEnable())
6
+ {
7
+ ?>
8
+ <!-- Google Tag Manager -->
9
+ <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
10
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
11
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
12
+ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
13
+ })(window,document,'script','dataLayer','<?php echo $_containerId ?>');</script>
14
+ <!-- End Google Tag Manager -->
15
+
16
+ <!-- Google Tag Manager (noscript) -->
17
+ <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=<?php echo $_containerId ?>"
18
+ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
19
+ <!-- End Google Tag Manager (noscript) -->
20
+ <?php
21
+ } ?>
app/etc/modules/Studio45_GoogleTagManager.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Studio45_GoogleTagManager>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Studio45_GoogleTagManager>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>One_Click_Google_Tag_Manager</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>OSL-3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>One click installation of Google Tag Manager ID within your store.</summary>
10
+ <description>The built is super easy to navigate between stuff and collaborate Google Analytics, AdWords, and third-party tags. One Click is the futuristic way to tag your tags on the website. With One click you can easily manage, track, reorganize and optimize tags inside the extension.</description>
11
+ <notes>One click installation of Google Tag Manager ID within your store.</notes>
12
+ <authors><author><name>wholesalesms</name><user>wholesalesms</user><email>support@wholesalesms.com.au</email></author></authors>
13
+ <date>2017-03-21</date>
14
+ <time>09:52:21</time>
15
+ <contents><target name="magecommunity"><dir name="Studio45"><dir name="GoogleTagManager"><dir name="Block"><file name="Gtm.php" hash="2890efe6527eee731bf03929fbe3271f"/><dir name="System"><dir name="Config"><file name="Info.php" hash="8b7c1b66c298fffaab150369228858e1"/><file name="Info.php" hash="8b7c1b66c298fffaab150369228858e1"/><file name="Info.php" hash="8b7c1b66c298fffaab150369228858e1"/><file name="Info.php" hash="8b7c1b66c298fffaab150369228858e1"/><file name="Info.php" hash="8b7c1b66c298fffaab150369228858e1"/></dir></dir><file name="Gtm.php" hash="2890efe6527eee731bf03929fbe3271f"/><file name="Gtm.php" hash="2890efe6527eee731bf03929fbe3271f"/><file name="Gtm.php" hash="2890efe6527eee731bf03929fbe3271f"/></dir><dir name="Controllers"><file name="IndexController.php" hash="712a3d97d048bb17e384da37f4983ff5"/><file name="IndexController.php" hash="712a3d97d048bb17e384da37f4983ff5"/><file name="IndexController.php" hash="712a3d97d048bb17e384da37f4983ff5"/><file name="IndexController.php" hash="712a3d97d048bb17e384da37f4983ff5"/></dir><dir name="Helper"><file name="Data.php" hash="7b11992114cc3a126d5257aea908c4f0"/><file name="Data.php" hash="7b11992114cc3a126d5257aea908c4f0"/><file name="Data.php" hash="7b11992114cc3a126d5257aea908c4f0"/><file name="Data.php" hash="7b11992114cc3a126d5257aea908c4f0"/></dir><dir name="Model"><file name="Gtm.php" hash="1c7f47fe958ae9218f22122b58fc6cd5"/><file name="Gtm.php" hash="1c7f47fe958ae9218f22122b58fc6cd5"/><file name="Gtm.php" hash="1c7f47fe958ae9218f22122b58fc6cd5"/><file name="Gtm.php" hash="1c7f47fe958ae9218f22122b58fc6cd5"/></dir><dir name="etc"><file name="adminhtml.xml" hash="01df22f5a350c49c391faa11b8c81644"/><file name="config.xml" hash="87c67b9f599c5705a04037c8084e2112"/><file name="system.xml" hash="bbdb72305a61c6ab3dae17ffa1a3c0fb"/><file name="adminhtml.xml" hash="01df22f5a350c49c391faa11b8c81644"/><file name="config.xml" hash="87c67b9f599c5705a04037c8084e2112"/><file name="system.xml" hash="bbdb72305a61c6ab3dae17ffa1a3c0fb"/><file name="adminhtml.xml" hash="01df22f5a350c49c391faa11b8c81644"/><file name="config.xml" hash="87c67b9f599c5705a04037c8084e2112"/><file name="system.xml" hash="bbdb72305a61c6ab3dae17ffa1a3c0fb"/><file name="adminhtml.xml" hash="01df22f5a350c49c391faa11b8c81644"/><file name="config.xml" hash="87c67b9f599c5705a04037c8084e2112"/><file name="system.xml" hash="bbdb72305a61c6ab3dae17ffa1a3c0fb"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Studio45_GoogleTagManager.xml" hash="48b20a4679316596214b3d645f5ae6dc"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="studio45"><file name="googletagmanager.xml" hash="ab81e2c5838af4bec49777ddea11c9fb"/><file name="googletagmanager.xml" hash="ab81e2c5838af4bec49777ddea11c9fb"/></dir></dir><dir name="template"><dir name="studio45"><dir name="googletagmanager"><file name="gtm.phtml" hash="4296938ae113a04763f5eb4d3b776a7a"/><file name="gtm.phtml" hash="4296938ae113a04763f5eb4d3b776a7a"/></dir></dir></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.1.0</min><max>7.0.17</max></php></required></dependencies>
18
+ </package>