Version Notes
1.0.2 - Added html/text help to admin config
1.0.1 - Fixed arrays that were rendering as strings
1.0.0 - refactored based on Tealium class
* added support for external UDO definition
* added support for diagnostic pixel
0.4.4d - added output of diagnostic pixel
0.4.4 - strip commas from all dollar values
0.4.3 - fix for bad array on order page
0.4.2 - added simple discount array
0.4.0 - fix for individual discounts and number formats
0.3.1 - fix for configurable product arrays
0.3.0 - fix for missing support message
0.2.0 - fix for product page tag syntax
0.1.0 - initial release
Download this release
Release Info
Developer | Tealium Inc. |
Extension | Tealium_Tags |
Version | 1.0.2 |
Comparing to | |
See all releases |
Code changes from version 0.4.4 to 1.0.2
- app/code/local/Tealium/Tags/Helper/Data.php +48 -1
- app/code/local/Tealium/Tags/etc/system.xml +614 -0
- app/design/frontend/base/default/layout/tealium_tags.xml +1 -0
- app/design/frontend/base/default/template/tealium_tags/base.phtml +4 -10
- app/design/frontend/base/default/template/tealium_tags/catalog_product_compare_index.phtml +14 -13
- app/design/frontend/base/default/template/tealium_tags/catalogsearch_advanced_result_index.phtml +12 -12
- app/design/frontend/base/default/template/tealium_tags/catalogsearch_result_index.phtml +4 -12
- app/design/frontend/base/default/template/tealium_tags/catalogsearch_term_popular.phtml +9 -11
- app/design/frontend/base/default/template/tealium_tags/category.phtml +5 -44
- app/design/frontend/base/default/template/tealium_tags/checkout_cart_index.phtml +14 -41
- app/design/frontend/base/default/template/tealium_tags/checkout_onepage.phtml +37 -41
- app/design/frontend/base/default/template/tealium_tags/checkout_success.phtml +14 -73
- app/design/frontend/base/default/template/tealium_tags/cms.phtml +4 -10
- app/design/frontend/base/default/template/tealium_tags/customer.phtml +5 -24
- app/design/frontend/base/default/template/tealium_tags/generic.phtml +6 -11
- app/design/frontend/base/default/template/tealium_tags/guest_sales.phtml +6 -11
- app/design/frontend/base/default/template/tealium_tags/product.phtml +18 -31
- app/design/frontend/base/default/template/tealium_tags/product_send.phtml +34 -32
- app/design/frontend/base/default/template/tealium_tags/seo.phtml +5 -11
- app/design/frontend/base/default/template/tealium_tags/tag_list_index.phtml +8 -11
- app/design/frontend/base/default/template/tealium_tags/tag_product_list.phtml +7 -13
- lib/Tealium/Tealium.php +256 -0
- lib/Tealium/TealiumAPI.php +70 -0
- lib/Tealium/TealiumInit.php +239 -0
- package.xml +11 -5
app/code/local/Tealium/Tags/Helper/Data.php
CHANGED
@@ -1,9 +1,38 @@
|
|
1 |
<?php
|
2 |
-
class Tealium_Tags_Helper_Data extends Mage_Core_Helper_Abstract {
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
public function isEnabled($store) {
|
5 |
return Mage::getStoreConfig('tealium_tags/general/enable', $store);
|
6 |
}
|
|
|
|
|
|
|
|
|
7 |
|
8 |
function getTealiumBaseUrl($store){
|
9 |
$account = $this->getAccount($store);
|
@@ -11,6 +40,11 @@ class Tealium_Tags_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
11 |
$env = $this->getEnv($store);
|
12 |
return "//tags.tiqcdn.com/utag/$account/$profile/$env/utag.js";
|
13 |
}
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
public function getAccount($store) {
|
16 |
return Mage::getStoreConfig('tealium_tags/general/account', $store);
|
@@ -19,9 +53,22 @@ class Tealium_Tags_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
19 |
public function getProfile($store) {
|
20 |
return Mage::getStoreConfig('tealium_tags/general/profile', $store);
|
21 |
}
|
|
|
22 |
public function getEnv($store) {
|
23 |
return Mage::getStoreConfig('tealium_tags/general/env', $store);
|
24 |
}
|
|
|
|
|
|
|
|
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
}
|
27 |
|
1 |
<?php
|
|
|
2 |
|
3 |
+
class Tealium_Tags_Helper_Data extends Mage_Core_Helper_Abstract {
|
4 |
+
|
5 |
+
private static $tealium;
|
6 |
+
|
7 |
+
public function init($store, $page = array()) {
|
8 |
+
require_once(Mage::getBaseDir('lib') . '/Tealium/Tealium.php');
|
9 |
+
$account = $this->getAccount($store);
|
10 |
+
$profile = $this->getProfile($store);
|
11 |
+
$env = $this->getEnv($store);
|
12 |
+
|
13 |
+
$data = array("store" => $store, "page" => $page);
|
14 |
+
$this->tealium = new Tealium($account,$profile,$env,"Home",$data);
|
15 |
+
if (Mage::getStoreConfig('tealium_tags/general/udo_enable', $store)){
|
16 |
+
@include_once(Mage::getStoreConfig('tealium_tags/general/udo', $store));
|
17 |
+
foreach (($udoElements?:array()) as $page => $vars){
|
18 |
+
if (is_array($vars)){
|
19 |
+
foreach ($vars as $pageKey => $pageValue){
|
20 |
+
$this->tealium->updateUdo($pageKey, $pageValue, $page);
|
21 |
+
}
|
22 |
+
}
|
23 |
+
}
|
24 |
+
}
|
25 |
+
$this->tealium->pageType("Home");
|
26 |
+
|
27 |
+
}
|
28 |
+
|
29 |
public function isEnabled($store) {
|
30 |
return Mage::getStoreConfig('tealium_tags/general/enable', $store);
|
31 |
}
|
32 |
+
|
33 |
+
public function externalUdoEnabled($store) {
|
34 |
+
return Mage::getStoreConfig('tealium_tags/general/udo_enable', $store);
|
35 |
+
}
|
36 |
|
37 |
function getTealiumBaseUrl($store){
|
38 |
$account = $this->getAccount($store);
|
40 |
$env = $this->getEnv($store);
|
41 |
return "//tags.tiqcdn.com/utag/$account/$profile/$env/utag.js";
|
42 |
}
|
43 |
+
|
44 |
+
function getTealiumObject($store, $page = array()){
|
45 |
+
$this->init($store, $page);
|
46 |
+
return $this->tealium;
|
47 |
+
}
|
48 |
|
49 |
public function getAccount($store) {
|
50 |
return Mage::getStoreConfig('tealium_tags/general/account', $store);
|
53 |
public function getProfile($store) {
|
54 |
return Mage::getStoreConfig('tealium_tags/general/profile', $store);
|
55 |
}
|
56 |
+
|
57 |
public function getEnv($store) {
|
58 |
return Mage::getStoreConfig('tealium_tags/general/env', $store);
|
59 |
}
|
60 |
+
|
61 |
+
public function getUDOPath($store) {
|
62 |
+
return Mage::getStoreConfig('tealium_tags/general/udo', $store);
|
63 |
+
}
|
64 |
|
65 |
+
public function getDiagnosticTag($store) {
|
66 |
+
if (Mage::getStoreConfig('tealium_tags/general/diagnostic_enable', $store)){
|
67 |
+
$utag_data= urlencode($this->tealium->render("json"));
|
68 |
+
$url = Mage::getStoreConfig('tealium_tags/general/diagnostic_tag', $store) . '?origin=server&user_agent='.$_SERVER['HTTP_USER_AGENT'].'&data='.$utag_data;
|
69 |
+
return '<img src="' . $url . '" style="display:none"/>';
|
70 |
+
}
|
71 |
+
return "";
|
72 |
+
}
|
73 |
}
|
74 |
|
app/code/local/Tealium/Tags/etc/system.xml
CHANGED
@@ -30,6 +30,9 @@
|
|
30 |
<fields>
|
31 |
<enable translate="label">
|
32 |
<label>Enable</label>
|
|
|
|
|
|
|
33 |
<frontend_type>select</frontend_type>
|
34 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
35 |
<sort_order>1</sort_order>
|
@@ -39,6 +42,9 @@
|
|
39 |
</enable>
|
40 |
<account translate="label">
|
41 |
<label>Account</label>
|
|
|
|
|
|
|
42 |
<frontend_type>text</frontend_type>
|
43 |
<sort_order>5</sort_order>
|
44 |
<show_in_default>1</show_in_default>
|
@@ -47,6 +53,9 @@
|
|
47 |
</account>
|
48 |
<profile translate="label">
|
49 |
<label>Profile</label>
|
|
|
|
|
|
|
50 |
<frontend_type>text</frontend_type>
|
51 |
<sort_order>10</sort_order>
|
52 |
<show_in_default>1</show_in_default>
|
@@ -55,12 +64,617 @@
|
|
55 |
</profile>
|
56 |
<env translate="label">
|
57 |
<label>Environment</label>
|
|
|
|
|
|
|
58 |
<frontend_type>text</frontend_type>
|
59 |
<sort_order>14</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 |
</env>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
</fields>
|
65 |
</general>
|
66 |
</groups>
|
30 |
<fields>
|
31 |
<enable translate="label">
|
32 |
<label>Enable</label>
|
33 |
+
<comment>
|
34 |
+
<![CDATA[<span class="notice">Enable/Disable this plugin</span>]]>
|
35 |
+
</comment>
|
36 |
<frontend_type>select</frontend_type>
|
37 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
38 |
<sort_order>1</sort_order>
|
42 |
</enable>
|
43 |
<account translate="label">
|
44 |
<label>Account</label>
|
45 |
+
<comment>
|
46 |
+
<![CDATA[<span class="notice">Tealium account name</span>]]>
|
47 |
+
</comment>
|
48 |
<frontend_type>text</frontend_type>
|
49 |
<sort_order>5</sort_order>
|
50 |
<show_in_default>1</show_in_default>
|
53 |
</account>
|
54 |
<profile translate="label">
|
55 |
<label>Profile</label>
|
56 |
+
<comment>
|
57 |
+
<![CDATA[<span class="notice">Tealium profile to use on all pages</span>]]>
|
58 |
+
</comment>
|
59 |
<frontend_type>text</frontend_type>
|
60 |
<sort_order>10</sort_order>
|
61 |
<show_in_default>1</show_in_default>
|
64 |
</profile>
|
65 |
<env translate="label">
|
66 |
<label>Environment</label>
|
67 |
+
<comment>
|
68 |
+
<![CDATA[<span class="notice">Tealium environment to load</span>]]>
|
69 |
+
</comment>
|
70 |
<frontend_type>text</frontend_type>
|
71 |
<sort_order>14</sort_order>
|
72 |
<show_in_default>1</show_in_default>
|
73 |
<show_in_website>1</show_in_website>
|
74 |
<show_in_store>1</show_in_store>
|
75 |
</env>
|
76 |
+
<udo_enable translate="label">
|
77 |
+
<label>Enable Custom UDO</label>
|
78 |
+
<comment>
|
79 |
+
<![CDATA[
|
80 |
+
<span class="notice">Enable the use of a custom PHP UDO definition file to extend the default Tealium Magento data layer</span>
|
81 |
+
]]>
|
82 |
+
</comment>
|
83 |
+
<frontend_type>select</frontend_type>
|
84 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
85 |
+
<sort_order>15</sort_order>
|
86 |
+
<show_in_default>1</show_in_default>
|
87 |
+
<show_in_website>1</show_in_website>
|
88 |
+
<show_in_store>1</show_in_store>
|
89 |
+
</udo_enable>
|
90 |
+
<udo translate="label">
|
91 |
+
<comment>
|
92 |
+
<![CDATA[
|
93 |
+
<span class="notice">Full system path of custom UDO definition file</span><br />
|
94 |
+
<a href="javascript:false;" onclick="javascript: document.getElementById('udo_example').style.display='block'">Click for example</a><br/>
|
95 |
+
<a href="javascript:false;" onclick="javascript: document.getElementById('code_example').style.display='block'">Click for UDO PHP base code</a>
|
96 |
+
<div style="display:none; background-color:#000; color:#0F0" id="udo_example">
|
97 |
+
/var/www/html/magento/udo/udo.php
|
98 |
+
<br /><a href="javascript:false;" onclick="javascript: document.getElementById('udo_example').style.display='none'">Hide</a>
|
99 |
+
</div>
|
100 |
+
<div style="display:none; background-color:#000; color:#0F0" id="code_example">
|
101 |
+
<pre>
|
102 |
+
<?php
|
103 |
+
// TealiumInit.php var definition file
|
104 |
+
// Replace $STRING or $ARRAY with your server side variable reference unique to that key
|
105 |
+
$store = $data["store"];
|
106 |
+
$page = $data["page"];
|
107 |
+
|
108 |
+
|
109 |
+
$udoElements = array(
|
110 |
+
Home => array(
|
111 |
+
foo => "bar",
|
112 |
+
test => "var",
|
113 |
+
site_region => "modified: " . Mage::app()->getLocale()->getLocaleCode() ?:
|
114 |
+
"", //"uk",
|
115 |
+
),
|
116 |
+
Search => array(
|
117 |
+
),
|
118 |
+
Category => array(
|
119 |
+
),
|
120 |
+
ProductPage => array(
|
121 |
+
),
|
122 |
+
Cart => array(
|
123 |
+
),
|
124 |
+
Confirmation => array(
|
125 |
+
),
|
126 |
+
Customer => array(
|
127 |
+
)
|
128 |
+
);
|
129 |
+
|
130 |
+
?>
|
131 |
+
</pre>
|
132 |
+
<br /><a href="javascript:false;" onclick="javascript: document.getElementById('code_example').style.display='none'">Hide</a>
|
133 |
+
</div>
|
134 |
+
]]>
|
135 |
+
</comment>
|
136 |
+
<label>Custom UDO file path</label>
|
137 |
+
<frontend_type>text</frontend_type>
|
138 |
+
<sort_order>16</sort_order>
|
139 |
+
<show_in_default>1</show_in_default>
|
140 |
+
<show_in_website>1</show_in_website>
|
141 |
+
<show_in_store>1</show_in_store>
|
142 |
+
</udo>
|
143 |
+
<diagnostic_enable translate="label">
|
144 |
+
<label>Enable Diagnostic Tag</label>
|
145 |
+
<frontend_type>select</frontend_type>
|
146 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
147 |
+
<sort_order>17</sort_order>
|
148 |
+
<show_in_default>1</show_in_default>
|
149 |
+
<show_in_website>1</show_in_website>
|
150 |
+
<show_in_store>1</show_in_store>
|
151 |
+
</diagnostic_enable>
|
152 |
+
<diagnostic_tag translate="label">
|
153 |
+
<label>Custom diagnostic tag URI path</label>
|
154 |
+
<comment>
|
155 |
+
<![CDATA[<span class="notice">Please contact your Account Manager for information about this feature</span>]]>
|
156 |
+
</comment>
|
157 |
+
<frontend_type>text</frontend_type>
|
158 |
+
<sort_order>18</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 |
+
</diagnostic_tag>
|
163 |
+
<api_enable translate="label">
|
164 |
+
<label>Enable API support</label>
|
165 |
+
<comment>
|
166 |
+
<![CDATA[<span class="notice">Please contact your Account Manager for information about this feature</span>]]>
|
167 |
+
</comment>
|
168 |
+
<frontend_type>select</frontend_type>
|
169 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
170 |
+
<sort_order>19</sort_order>
|
171 |
+
<show_in_default>1</show_in_default>
|
172 |
+
<show_in_website>1</show_in_website>
|
173 |
+
<show_in_store>1</show_in_store>
|
174 |
+
</api_enable>
|
175 |
+
<help translate="label">
|
176 |
+
<label>Help Section</label>
|
177 |
+
<comment>
|
178 |
+
<![CDATA[
|
179 |
+
<span class="notice">Help Section on configuration of this plugin</span><br />
|
180 |
+
<a href="javascript:false;" onclick="javascript: document.getElementById('tealium_help').style.display='block'">Click to expand</a>
|
181 |
+
<div style="display:none; background-color:#000; color:#0F0; width:250%" id="tealium_help">
|
182 |
+
|
183 |
+
<!-- ------------------------------------------------------------------------- -->
|
184 |
+
<div id="readme" >
|
185 |
+
<span class="name">
|
186 |
+
<span class="octicon octicon-book"></span>
|
187 |
+
README.md
|
188 |
+
</span>
|
189 |
+
|
190 |
+
<article class="markdown-body entry-content" itemprop="mainContentOfPage"><h1>
|
191 |
+
<a name="user-content-tealium-extension-for-magento---102" class="anchor" href="#tealium-extension-for-magento---102"><span class="octicon octicon-link"></span></a>Tealium Extension for Magento - 1.0.2</h1>
|
192 |
+
|
193 |
+
<hr><p>This Extension for Magento provides Tealium customers the means to easily tag their magento sites for the purpose of leveraging the vendor-neutral tag management platform offered by Tealium. </p>
|
194 |
+
|
195 |
+
<p>This Extension provides for:</p>
|
196 |
+
|
197 |
+
<ul>
|
198 |
+
<li>Making integration of Tealium into a Magento site more efficient</li>
|
199 |
+
<li>The ability to extend the default data layer in the extension via a user defined PHP file</li>
|
200 |
+
<li>Vendor integration via the Tealium platform</li>
|
201 |
+
<li>Implemented with the user in mind. All generated Tealium scripts are asynchronous as to not interfere or degrade the user experience. </li>
|
202 |
+
</ul><p>These instructions presume you have valid accounts with both Tealium and the vendors you want to send data to, as well as an installed Magento instance and the knowledge on how to administer it.</p>
|
203 |
+
|
204 |
+
<p>Implementation is a three part process:
|
205 |
+
1. Get the Tealium extension from the Magento Connect Market
|
206 |
+
- <a href="http://www.magentocommerce.com/magento-connect/tealium-tag-management-1.html">Link to Tealium on Magento Connect</a>
|
207 |
+
2. Install the Tealium Extension for Magento via the Magento Connect Manager in your Magento admin UI
|
208 |
+
3. Configure the Tealium extension in the system configuration of your admin UI
|
209 |
+
- optional: configure the custom PHP UDO definition file to extend the already included UDO (data layer) definition file
|
210 |
+
4. Configure your Tealium IQ dashboard with any vendor tags from our marketplace and publish</p>
|
211 |
+
|
212 |
+
<hr><h2>
|
213 |
+
<a name="user-content-table-of-contents" class="anchor" href="#table-of-contents"><span class="octicon octicon-link"></span></a>Table of Contents</h2>
|
214 |
+
|
215 |
+
<ul>
|
216 |
+
<li><a href="#requirements">Requirements</a></li>
|
217 |
+
<li><a href="#new-installation">New Installation</a></li>
|
218 |
+
<li><a href="#how-to-use">How To Use</a></li>
|
219 |
+
<li><a href="#tealium-iq-basic-set-up--verification-test">Tealium IQ Basic Set Up + Verification Test</a></li>
|
220 |
+
<li><a href="#versions">Versions</a></li>
|
221 |
+
</ul><h2>
|
222 |
+
<a name="user-content-requirements" class="anchor" href="#requirements"><span class="octicon octicon-link"></span></a>Requirements</h2>
|
223 |
+
|
224 |
+
<p>You will need the following items:</p>
|
225 |
+
|
226 |
+
<ul>
|
227 |
+
<li>An active Tealium IQ Account</li>
|
228 |
+
<li>Your Tealium Account Id (it will likely be your company name)</li>
|
229 |
+
<li>The Tealium Profile name to be associated with the app (your account may have several profiles, ideally one of them is dedicated to your iOS app)</li>
|
230 |
+
<li>The Tealium environment to use:
|
231 |
+
|
232 |
+
<ul>
|
233 |
+
<li>prod</li>
|
234 |
+
<li>qa</li>
|
235 |
+
<li>dev</li>
|
236 |
+
<li>custom</li>
|
237 |
+
</ul>
|
238 |
+
</li>
|
239 |
+
<li>Minimum PHP version 5.1.0</li>
|
240 |
+
<li>Minimum Magento version 1.6</li>
|
241 |
+
</ul><h2>
|
242 |
+
<a name="user-content-new-installation" class="anchor" href="#new-installation"><span class="octicon octicon-link"></span></a>New Installation</h2>
|
243 |
+
|
244 |
+
<p>Installing the Tealium Extension into your instance of Magento requires the following steps:</p>
|
245 |
+
|
246 |
+
<ol>
|
247 |
+
<li>Get the Tealium extension from the Magento Connect Market
|
248 |
+
|
249 |
+
<ul>
|
250 |
+
<li><a href="http://www.magentocommerce.com/magento-connect/tealium-tag-management-1.html">Link to Tealium on Magento Connect</a></li>
|
251 |
+
</ul>
|
252 |
+
</li>
|
253 |
+
<li>Install the Tealium Extension for Magento via the Magento Connect Manager in your Magento admin UI</li>
|
254 |
+
<li>Configure the Tealium extension in the system configuration of your admin UI
|
255 |
+
|
256 |
+
<ul>
|
257 |
+
<li>optional: configure the custom PHP UDO definition file to extend the already included UDO (data layer) definition file</li>
|
258 |
+
</ul>
|
259 |
+
</li>
|
260 |
+
<li>All relevent best practices eCommerce variables will now be generated on your site any tags you have set up in TealiumIQ will now work automatically</li>
|
261 |
+
</ol><h2>
|
262 |
+
<a name="user-content-dependencies" class="anchor" href="#dependencies"><span class="octicon octicon-link"></span></a>Dependencies</h2>
|
263 |
+
|
264 |
+
<p>A live installation of Magento community or enterpise</p>
|
265 |
+
|
266 |
+
<h2>
|
267 |
+
<a name="user-content-how-to-use" class="anchor" href="#how-to-use"><span class="octicon octicon-link"></span></a>How To Use</h2>
|
268 |
+
|
269 |
+
<h3>
|
270 |
+
<a name="user-content-predefined-data-layer-varaibles-already-available" class="anchor" href="#predefined-data-layer-varaibles-already-available"><span class="octicon octicon-link"></span></a>Predefined data layer varaibles already available</h3>
|
271 |
+
|
272 |
+
<h4>
|
273 |
+
<a name="user-content-home" class="anchor" href="#home"><span class="octicon octicon-link"></span></a>Home</h4>
|
274 |
+
|
275 |
+
<h6>
|
276 |
+
<a name="user-content-site_region" class="anchor" href="#site_region"><span class="octicon octicon-link"></span></a>site_region</h6>
|
277 |
+
|
278 |
+
<h6>
|
279 |
+
<a name="user-content-site_currency" class="anchor" href="#site_currency"><span class="octicon octicon-link"></span></a>site_currency</h6>
|
280 |
+
|
281 |
+
<h6>
|
282 |
+
<a name="user-content-page_name" class="anchor" href="#page_name"><span class="octicon octicon-link"></span></a>page_name</h6>
|
283 |
+
|
284 |
+
<h6>
|
285 |
+
<a name="user-content-page_type" class="anchor" href="#page_type"><span class="octicon octicon-link"></span></a>page_type</h6>
|
286 |
+
|
287 |
+
<h4>
|
288 |
+
<a name="user-content-search" class="anchor" href="#search"><span class="octicon octicon-link"></span></a>Search</h4>
|
289 |
+
|
290 |
+
<h6>
|
291 |
+
<a name="user-content-site_region-1" class="anchor" href="#site_region-1"><span class="octicon octicon-link"></span></a>site_region</h6>
|
292 |
+
|
293 |
+
<h6>
|
294 |
+
<a name="user-content-site_currency-1" class="anchor" href="#site_currency-1"><span class="octicon octicon-link"></span></a>site_currency</h6>
|
295 |
+
|
296 |
+
<h6>
|
297 |
+
<a name="user-content-page_name-1" class="anchor" href="#page_name-1"><span class="octicon octicon-link"></span></a>page_name</h6>
|
298 |
+
|
299 |
+
<h6>
|
300 |
+
<a name="user-content-page_type-1" class="anchor" href="#page_type-1"><span class="octicon octicon-link"></span></a>page_type</h6>
|
301 |
+
|
302 |
+
<h6>
|
303 |
+
<a name="user-content-search_results" class="anchor" href="#search_results"><span class="octicon octicon-link"></span></a>search_results</h6>
|
304 |
+
|
305 |
+
<h6>
|
306 |
+
<a name="user-content-search_keyword" class="anchor" href="#search_keyword"><span class="octicon octicon-link"></span></a>search_keyword</h6>
|
307 |
+
|
308 |
+
<h4>
|
309 |
+
<a name="user-content-category" class="anchor" href="#category"><span class="octicon octicon-link"></span></a>Category</h4>
|
310 |
+
|
311 |
+
<h6>
|
312 |
+
<a name="user-content-site_region-2" class="anchor" href="#site_region-2"><span class="octicon octicon-link"></span></a>site_region</h6>
|
313 |
+
|
314 |
+
<h6>
|
315 |
+
<a name="user-content-site_currency-2" class="anchor" href="#site_currency-2"><span class="octicon octicon-link"></span></a>site_currency</h6>
|
316 |
+
|
317 |
+
<h6>
|
318 |
+
<a name="user-content-page_name-2" class="anchor" href="#page_name-2"><span class="octicon octicon-link"></span></a>page_name</h6>
|
319 |
+
|
320 |
+
<h6>
|
321 |
+
<a name="user-content-page_type-2" class="anchor" href="#page_type-2"><span class="octicon octicon-link"></span></a>page_type</h6>
|
322 |
+
|
323 |
+
<h6>
|
324 |
+
<a name="user-content-page_section_name" class="anchor" href="#page_section_name"><span class="octicon octicon-link"></span></a>page_section_name</h6>
|
325 |
+
|
326 |
+
<h6>
|
327 |
+
<a name="user-content-page_category_name" class="anchor" href="#page_category_name"><span class="octicon octicon-link"></span></a>page_category_name</h6>
|
328 |
+
|
329 |
+
<h6>
|
330 |
+
<a name="user-content-page_subcategory_name" class="anchor" href="#page_subcategory_name"><span class="octicon octicon-link"></span></a>page_subcategory_name</h6>
|
331 |
+
|
332 |
+
<h4>
|
333 |
+
<a name="user-content-productpage" class="anchor" href="#productpage"><span class="octicon octicon-link"></span></a>ProductPage</h4>
|
334 |
+
|
335 |
+
<h6>
|
336 |
+
<a name="user-content-site_region-3" class="anchor" href="#site_region-3"><span class="octicon octicon-link"></span></a>site_region</h6>
|
337 |
+
|
338 |
+
<h6>
|
339 |
+
<a name="user-content-site_currency-3" class="anchor" href="#site_currency-3"><span class="octicon octicon-link"></span></a>site_currency</h6>
|
340 |
+
|
341 |
+
<h6>
|
342 |
+
<a name="user-content-page_name-3" class="anchor" href="#page_name-3"><span class="octicon octicon-link"></span></a>page_name</h6>
|
343 |
+
|
344 |
+
<h6>
|
345 |
+
<a name="user-content-page_type-3" class="anchor" href="#page_type-3"><span class="octicon octicon-link"></span></a>page_type</h6>
|
346 |
+
|
347 |
+
<h6>
|
348 |
+
<a name="user-content-product_id" class="anchor" href="#product_id"><span class="octicon octicon-link"></span></a>product_id</h6>
|
349 |
+
|
350 |
+
<h6>
|
351 |
+
<a name="user-content-product_sku" class="anchor" href="#product_sku"><span class="octicon octicon-link"></span></a>product_sku</h6>
|
352 |
+
|
353 |
+
<h6>
|
354 |
+
<a name="user-content-product_name" class="anchor" href="#product_name"><span class="octicon octicon-link"></span></a>product_name</h6>
|
355 |
+
|
356 |
+
<h6>
|
357 |
+
<a name="user-content-product_brand" class="anchor" href="#product_brand"><span class="octicon octicon-link"></span></a>product_brand</h6>
|
358 |
+
|
359 |
+
<h6>
|
360 |
+
<a name="user-content-product_category" class="anchor" href="#product_category"><span class="octicon octicon-link"></span></a>product_category</h6>
|
361 |
+
|
362 |
+
<h6>
|
363 |
+
<a name="user-content-product_unit_price" class="anchor" href="#product_unit_price"><span class="octicon octicon-link"></span></a>product_unit_price</h6>
|
364 |
+
|
365 |
+
<h6>
|
366 |
+
<a name="user-content-product_list_price" class="anchor" href="#product_list_price"><span class="octicon octicon-link"></span></a>product_list_price</h6>
|
367 |
+
|
368 |
+
<h4>
|
369 |
+
<a name="user-content-cart" class="anchor" href="#cart"><span class="octicon octicon-link"></span></a>Cart</h4>
|
370 |
+
|
371 |
+
<h6>
|
372 |
+
<a name="user-content-site_region-4" class="anchor" href="#site_region-4"><span class="octicon octicon-link"></span></a>site_region</h6>
|
373 |
+
|
374 |
+
<h6>
|
375 |
+
<a name="user-content-site_currency-4" class="anchor" href="#site_currency-4"><span class="octicon octicon-link"></span></a>site_currency</h6>
|
376 |
+
|
377 |
+
<h6>
|
378 |
+
<a name="user-content-page_name-4" class="anchor" href="#page_name-4"><span class="octicon octicon-link"></span></a>page_name</h6>
|
379 |
+
|
380 |
+
<h6>
|
381 |
+
<a name="user-content-page_type-4" class="anchor" href="#page_type-4"><span class="octicon octicon-link"></span></a>page_type</h6>
|
382 |
+
|
383 |
+
<h6>
|
384 |
+
<a name="user-content-product_id-1" class="anchor" href="#product_id-1"><span class="octicon octicon-link"></span></a>product_id</h6>
|
385 |
+
|
386 |
+
<h6>
|
387 |
+
<a name="user-content-product_sku-1" class="anchor" href="#product_sku-1"><span class="octicon octicon-link"></span></a>product_sku</h6>
|
388 |
+
|
389 |
+
<h6>
|
390 |
+
<a name="user-content-product_name-1" class="anchor" href="#product_name-1"><span class="octicon octicon-link"></span></a>product_name</h6>
|
391 |
+
|
392 |
+
<h6>
|
393 |
+
<a name="user-content-product_quantity" class="anchor" href="#product_quantity"><span class="octicon octicon-link"></span></a>product_quantity</h6>
|
394 |
+
|
395 |
+
<h6>
|
396 |
+
<a name="user-content-product_list_price-1" class="anchor" href="#product_list_price-1"><span class="octicon octicon-link"></span></a>product_list_price</h6>
|
397 |
+
|
398 |
+
<h4>
|
399 |
+
<a name="user-content-confirmation" class="anchor" href="#confirmation"><span class="octicon octicon-link"></span></a>Confirmation</h4>
|
400 |
+
|
401 |
+
<h6>
|
402 |
+
<a name="user-content-site_region-5" class="anchor" href="#site_region-5"><span class="octicon octicon-link"></span></a>site_region</h6>
|
403 |
+
|
404 |
+
<h6>
|
405 |
+
<a name="user-content-site_currency-5" class="anchor" href="#site_currency-5"><span class="octicon octicon-link"></span></a>site_currency</h6>
|
406 |
+
|
407 |
+
<h6>
|
408 |
+
<a name="user-content-page_name-5" class="anchor" href="#page_name-5"><span class="octicon octicon-link"></span></a>page_name</h6>
|
409 |
+
|
410 |
+
<h6>
|
411 |
+
<a name="user-content-page_type-5" class="anchor" href="#page_type-5"><span class="octicon octicon-link"></span></a>page_type</h6>
|
412 |
+
|
413 |
+
<h6>
|
414 |
+
<a name="user-content-order_id" class="anchor" href="#order_id"><span class="octicon octicon-link"></span></a>order_id</h6>
|
415 |
+
|
416 |
+
<h6>
|
417 |
+
<a name="user-content-order_discount" class="anchor" href="#order_discount"><span class="octicon octicon-link"></span></a>order_discount</h6>
|
418 |
+
|
419 |
+
<h6>
|
420 |
+
<a name="user-content-order_subtotal" class="anchor" href="#order_subtotal"><span class="octicon octicon-link"></span></a>order_subtotal</h6>
|
421 |
+
|
422 |
+
<h6>
|
423 |
+
<a name="user-content-order_shipping" class="anchor" href="#order_shipping"><span class="octicon octicon-link"></span></a>order_shipping</h6>
|
424 |
+
|
425 |
+
<h6>
|
426 |
+
<a name="user-content-order_tax" class="anchor" href="#order_tax"><span class="octicon octicon-link"></span></a>order_tax</h6>
|
427 |
+
|
428 |
+
<h6>
|
429 |
+
<a name="user-content-order_payment_type" class="anchor" href="#order_payment_type"><span class="octicon octicon-link"></span></a>order_payment_type</h6>
|
430 |
+
|
431 |
+
<h6>
|
432 |
+
<a name="user-content-order_total" class="anchor" href="#order_total"><span class="octicon octicon-link"></span></a>order_total</h6>
|
433 |
+
|
434 |
+
<h6>
|
435 |
+
<a name="user-content-order_currency" class="anchor" href="#order_currency"><span class="octicon octicon-link"></span></a>order_currency</h6>
|
436 |
+
|
437 |
+
<h6>
|
438 |
+
<a name="user-content-customer_id" class="anchor" href="#customer_id"><span class="octicon octicon-link"></span></a>customer_id</h6>
|
439 |
+
|
440 |
+
<h6>
|
441 |
+
<a name="user-content-customer_email" class="anchor" href="#customer_email"><span class="octicon octicon-link"></span></a>customer_email</h6>
|
442 |
+
|
443 |
+
<h6>
|
444 |
+
<a name="user-content-product_id-2" class="anchor" href="#product_id-2"><span class="octicon octicon-link"></span></a>product_id</h6>
|
445 |
+
|
446 |
+
<h6>
|
447 |
+
<a name="user-content-product_sku-2" class="anchor" href="#product_sku-2"><span class="octicon octicon-link"></span></a>product_sku</h6>
|
448 |
+
|
449 |
+
<h6>
|
450 |
+
<a name="user-content-product_name-2" class="anchor" href="#product_name-2"><span class="octicon octicon-link"></span></a>product_name</h6>
|
451 |
+
|
452 |
+
<h6>
|
453 |
+
<a name="user-content-product_list_price-2" class="anchor" href="#product_list_price-2"><span class="octicon octicon-link"></span></a>product_list_price</h6>
|
454 |
+
|
455 |
+
<h6>
|
456 |
+
<a name="user-content-product_quantity-1" class="anchor" href="#product_quantity-1"><span class="octicon octicon-link"></span></a>product_quantity</h6>
|
457 |
+
|
458 |
+
<h6>
|
459 |
+
<a name="user-content-product_discount" class="anchor" href="#product_discount"><span class="octicon octicon-link"></span></a>product_discount</h6>
|
460 |
+
|
461 |
+
<h6>
|
462 |
+
<a name="user-content-product_discounts" class="anchor" href="#product_discounts"><span class="octicon octicon-link"></span></a>product_discounts</h6>
|
463 |
+
|
464 |
+
<h6>
|
465 |
+
<a name="user-content-site_region-6" class="anchor" href="#site_region-6"><span class="octicon octicon-link"></span></a>site_region</h6>
|
466 |
+
|
467 |
+
<h6>
|
468 |
+
<a name="user-content-site_currency-6" class="anchor" href="#site_currency-6"><span class="octicon octicon-link"></span></a>site_currency</h6>
|
469 |
+
|
470 |
+
<h6>
|
471 |
+
<a name="user-content-page_name-6" class="anchor" href="#page_name-6"><span class="octicon octicon-link"></span></a>page_name</h6>
|
472 |
+
|
473 |
+
<h6>
|
474 |
+
<a name="user-content-page_type-6" class="anchor" href="#page_type-6"><span class="octicon octicon-link"></span></a>page_type</h6>
|
475 |
+
|
476 |
+
<h6>
|
477 |
+
<a name="user-content-customer_id-1" class="anchor" href="#customer_id-1"><span class="octicon octicon-link"></span></a>customer_id</h6>
|
478 |
+
|
479 |
+
<h6>
|
480 |
+
<a name="user-content-customer_email-1" class="anchor" href="#customer_email-1"><span class="octicon octicon-link"></span></a>customer_email</h6>
|
481 |
+
|
482 |
+
<h6>
|
483 |
+
<a name="user-content-customer_type" class="anchor" href="#customer_type"><span class="octicon octicon-link"></span></a>customer_type</h6>
|
484 |
+
|
485 |
+
<h3>
|
486 |
+
<a name="user-content-adding-custom-data-sources" class="anchor" href="#adding-custom-data-sources"><span class="octicon octicon-link"></span></a>Adding Custom Data Sources</h3>
|
487 |
+
|
488 |
+
<p>If the you need to modify the default variables or page types you can define these in an external file and place it in accesible folder for the plugin to read from.</p>
|
489 |
+
|
490 |
+
<ol>
|
491 |
+
<li>In the Magento admin configuration set Enable Custom UDO to "Yes"</li>
|
492 |
+
<li>Specify the system path to the file in the configuration</li>
|
493 |
+
<li>If you need a base PHP block to start with click the "Click for UDO PHP base code" link and copy this code</li>
|
494 |
+
</ol><h2>
|
495 |
+
<a name="user-content-tealium-iq-basic-set-up--verification-test" class="anchor" href="#tealium-iq-basic-set-up--verification-test"><span class="octicon octicon-link"></span></a>Tealium IQ Basic Set Up + Verification Test</h2>
|
496 |
+
|
497 |
+
<p>This example is for mapping two variables to a Google Analytics account to your app through the Tealium Management Console. This example presumes you have already done the following:</p>
|
498 |
+
|
499 |
+
<ul>
|
500 |
+
<li>Setup a Google analytics account from <a href="http://www.google.com/analytics/">www.google.com/analytics/</a>
|
501 |
+
</li>
|
502 |
+
<li>Have added Tealium tracking code to your project (see instructions above)</li>
|
503 |
+
<li>Have a Tealium account at <a href="http://www.tealium.com">www.tealium.com</a>
|
504 |
+
</li>
|
505 |
+
</ul><p>Verification steps are:</p>
|
506 |
+
|
507 |
+
<ol>
|
508 |
+
<li><p>Log into your Tealium account</p></li>
|
509 |
+
<li><p>Load the Account and Profile that matches the Account and Profile used in your <strong>Tealium($accountInit, $profileInit, $targetInit[, $pageType][, $data])</strong> method.</p></li>
|
510 |
+
<li>
|
511 |
+
<p>Goto the <strong>Data Sources</strong> tab and add the following new data source: </p>
|
512 |
+
|
513 |
+
<ul>
|
514 |
+
<li>screen_title</li>
|
515 |
+
</ul>
|
516 |
+
<p>Note: leave them as the default type: Data Layer. <em>screen_title</em> are your views' viewcontroller title or nibName property.
|
517 |
+
Optional: copy and paste the entire set of predefined Data Sources found at: <a href="https://community.tealiumiq.com/series/3333/posts/625639">https://community.tealiumiq.com/series/3333/posts/625639</a></p>
|
518 |
+
</li>
|
519 |
+
<li>
|
520 |
+
<p>Go to the <strong>Tags</strong> tab:</p>
|
521 |
+
|
522 |
+
<ul>
|
523 |
+
<li>click on the <em>+Add Tag</em> button</li>
|
524 |
+
<li>select Google Analytics</li>
|
525 |
+
<li>enter any title (ie "GAN") in the title field</li>
|
526 |
+
<li>enter your Google Analytics product id into the account id field (this is the account id assigned by Google and usually starts with the letters <em>UA</em>...)</li>
|
527 |
+
<li>click on the <em>Next</em> button</li>
|
528 |
+
<li>make sure the <em>Display All Pages</em> option is checked on in the Load Rules section</li>
|
529 |
+
<li>click on the <em>Next</em> button</li>
|
530 |
+
<li>in the <em>Source Values</em> dropdown - select <em>screen_title(js)</em> - click on <em>Select Variable</em>
|
531 |
+
</li>
|
532 |
+
<li>select <em>Page Name (Override)</em> option in the Mapping Toolbox</li>
|
533 |
+
<li>click <em>save</em>
|
534 |
+
</li>
|
535 |
+
<li>click <em>save</em>
|
536 |
+
</li>
|
537 |
+
<li>click on the <em>finish</em>
|
538 |
+
</li>
|
539 |
+
</ul>
|
540 |
+
</li>
|
541 |
+
<li>
|
542 |
+
<p>Click on the <em>Save/Publish</em> button</p>
|
543 |
+
|
544 |
+
<ul>
|
545 |
+
<li>Click on Configure Publish Options... The Publish Settings dialog box will appear. Make certain the "Enable Mobile App Support" option is checked on and click "Apply". </li>
|
546 |
+
<li>Enter any <em>Version Notes</em> regarding this deployment</li>
|
547 |
+
<li>Select the <em>Publish Location</em> that matches the <em>environmentName</em>, or target argument from your <em>initSharedInstance:profile:target:</em> method</li>
|
548 |
+
<li>Click "Save"</li>
|
549 |
+
</ul>
|
550 |
+
<p>NOTE: It may take up to five minutes for your newly published settings to take effect.</p>
|
551 |
+
</li>
|
552 |
+
<li><p>Log into your Google Analytics dash board - goto your real time tracking section</p></li>
|
553 |
+
<li><p>Launch your app and interact with it. You should see view appearances (page changes) show in your Google Analytics dashboard</p></li>
|
554 |
+
</ol><h2>
|
555 |
+
<a name="user-content-faq" class="anchor" href="#faq"><span class="octicon octicon-link"></span></a>FAQ</h2>
|
556 |
+
|
557 |
+
<h2></h2>
|
558 |
+
|
559 |
+
<h2>
|
560 |
+
<a name="user-content-troubleshooting" class="anchor" href="#troubleshooting"><span class="octicon octicon-link"></span></a>Troubleshooting</h2>
|
561 |
+
|
562 |
+
<ul>
|
563 |
+
<li>A few of our customers have found that after installing the Tealium plugin for Magento and trying to go to its related configuration page they will come across a "404 Error Page not found." This covers some solutions to resolve the issue.
|
564 |
+
There are a few things to try when you get this error. They are, in order of severity:
|
565 |
+
|
566 |
+
<ul>
|
567 |
+
<li>Log out, then log back in
|
568 |
+
|
569 |
+
<ul>
|
570 |
+
<li>The first is self explanatory. Simply log out of the Magento admin area, then log back in. This should reset some of the Magento cache and hopefully allow access the config page. If this does not work, try completely flushing the Magento Cache. </li>
|
571 |
+
</ul>
|
572 |
+
</li>
|
573 |
+
<li>Flush the Magento cache
|
574 |
+
|
575 |
+
<ul>
|
576 |
+
<li>Go to System -> Cache Management</li>
|
577 |
+
<li>Click the Flush Magento Cache button.</li>
|
578 |
+
<li>Then log out, and log back in</li>
|
579 |
+
<li>Try accessing the configuration page.</li>
|
580 |
+
<li>If you still get a 404 Error, the next step is to manually Reset the Administrator Roles.</li>
|
581 |
+
</ul>
|
582 |
+
</li>
|
583 |
+
<li>Reset the Administrator roles
|
584 |
+
|
585 |
+
<ul>
|
586 |
+
<li>Go to System -> Permissions -> Roles</li>
|
587 |
+
<li>Now click on the Administrators role in the list. There may only be one item listed, or maybe more.</li>
|
588 |
+
<li>Click the Role Users item on the left, then the Reset Filter button on the right. Lastly click the Save Role button at the top right.</li>
|
589 |
+
<li>Now go through the process of Flushing the Magento cache, and again log out and log back in.</li>
|
590 |
+
</ul>
|
591 |
+
</li>
|
592 |
+
</ul>
|
593 |
+
</li>
|
594 |
+
</ul><p>One of these techniques should fix the problem. If you are still experiencing 404 Errors after trying all of these solutions, get in contact with us and we will help you as best we can.</p>
|
595 |
+
|
596 |
+
<h2>
|
597 |
+
<a name="user-content-known-limitations-of-current-build" class="anchor" href="#known-limitations-of-current-build"><span class="octicon octicon-link"></span></a>Known Limitations of Current Build</h2>
|
598 |
+
|
599 |
+
<h2></h2>
|
600 |
+
|
601 |
+
<h2>
|
602 |
+
<a name="user-content-versions" class="anchor" href="#versions"><span class="octicon octicon-link"></span></a>Versions</h2>
|
603 |
+
|
604 |
+
<p><em>1.0.2</em> </p>
|
605 |
+
|
606 |
+
<ul>
|
607 |
+
<li>Added html/text help to admin config</li>
|
608 |
+
</ul><p><em>1.0.1</em> </p>
|
609 |
+
|
610 |
+
<ul>
|
611 |
+
<li>Fixed arrays that were rendering as strings</li>
|
612 |
+
</ul><p><em>1.0.0</em> </p>
|
613 |
+
|
614 |
+
<ul>
|
615 |
+
<li>refactored based on Tealium class</li>
|
616 |
+
<li>added support for external UDO definition</li>
|
617 |
+
<li>added support for diagnostic pixel</li>
|
618 |
+
</ul><p><em>0.4.4d</em> </p>
|
619 |
+
|
620 |
+
<ul>
|
621 |
+
<li>added output of diagnostic pixel</li>
|
622 |
+
</ul><p><em>0.4.4</em> </p>
|
623 |
+
|
624 |
+
<ul>
|
625 |
+
<li>strip commas from all dollar values</li>
|
626 |
+
</ul><p><em>0.4.3</em> </p>
|
627 |
+
|
628 |
+
<ul>
|
629 |
+
<li>fix for bad array on order page</li>
|
630 |
+
</ul><p><em>0.4.2</em> </p>
|
631 |
+
|
632 |
+
<ul>
|
633 |
+
<li>added simple discount array</li>
|
634 |
+
</ul><p><em>0.4.0</em> </p>
|
635 |
+
|
636 |
+
<ul>
|
637 |
+
<li>fix for individual discounts and number formats</li>
|
638 |
+
</ul><p><em>0.3.1</em> </p>
|
639 |
+
|
640 |
+
<ul>
|
641 |
+
<li>fix for configurable product arrays</li>
|
642 |
+
</ul><p><em>0.3.0</em> </p>
|
643 |
+
|
644 |
+
<ul>
|
645 |
+
<li>fix for missing support message</li>
|
646 |
+
</ul><p><em>0.2.0</em> </p>
|
647 |
+
|
648 |
+
<ul>
|
649 |
+
<li>fix for product page tag syntax</li>
|
650 |
+
</ul><p><em>0.1.0</em> </p>
|
651 |
+
|
652 |
+
<ul>
|
653 |
+
<li>initial release</li>
|
654 |
+
</ul><h2>
|
655 |
+
<a name="user-content-support" class="anchor" href="#support"><span class="octicon octicon-link"></span></a>Support</h2>
|
656 |
+
|
657 |
+
<p>For additional help and support, please send all inquires to your Account Manager or post questions on our community site at: <a href="https://community.tealiumiq.com">https://community.tealiumiq.com</a></p>
|
658 |
+
|
659 |
+
<h2>
|
660 |
+
<a name="user-content-about" class="anchor" href="#about"><span class="octicon octicon-link"></span></a>About</h2>
|
661 |
+
|
662 |
+
<p>Tealium PHP Library developed by Patrick McWilliams
|
663 |
+
Copyright © 2014 Tealium, Inc. All rights reserved.</p></article>
|
664 |
+
</div>
|
665 |
+
|
666 |
+
<!-- ------------------------------------------------------------------------- -->
|
667 |
+
|
668 |
+
<br /><a href="javascript:false;" onclick="javascript: document.getElementById('tealium_help').style.display='none'">Hide</a>
|
669 |
+
</div>
|
670 |
+
]]>
|
671 |
+
</comment>
|
672 |
+
<frontend_type>label</frontend_type>
|
673 |
+
<sort_order>20</sort_order>
|
674 |
+
<show_in_default>1</show_in_default>
|
675 |
+
<show_in_website>1</show_in_website>
|
676 |
+
<show_in_store>1</show_in_store>
|
677 |
+
</help>
|
678 |
</fields>
|
679 |
</general>
|
680 |
</groups>
|
app/design/frontend/base/default/layout/tealium_tags.xml
CHANGED
@@ -385,4 +385,5 @@
|
|
385 |
<block type="core/template" name="tealium_generic" as="tealium_generic" template="tealium_tags/generic.phtml" before="tealium_base" />
|
386 |
</reference>
|
387 |
</default>
|
|
|
388 |
</layout>
|
385 |
<block type="core/template" name="tealium_generic" as="tealium_generic" template="tealium_tags/generic.phtml" before="tealium_base" />
|
386 |
</reference>
|
387 |
</default>
|
388 |
+
|
389 |
</layout>
|
app/design/frontend/base/default/template/tealium_tags/base.phtml
CHANGED
@@ -1,18 +1,12 @@
|
|
1 |
<?php
|
2 |
$helper = Mage::helper('tealium_tags');
|
3 |
$store = Mage::app()->getStore();
|
|
|
4 |
|
5 |
if (!$helper->isEnabled($store)) {
|
6 |
return; // not enabled, no javascript inserted
|
7 |
}
|
8 |
-
?>
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
a='<?php echo $helper->getTealiumBaseUrl($store); ?>';
|
14 |
-
b=document;c='script';d=b.createElement(c);d.src=a;d.type='text/java'+c;d.
|
15 |
-
async=true;
|
16 |
-
a=b.getElementsByTagName(c)[0];a.parentNode.insertBefore(d,a);
|
17 |
-
})();
|
18 |
-
</script>
|
1 |
<?php
|
2 |
$helper = Mage::helper('tealium_tags');
|
3 |
$store = Mage::app()->getStore();
|
4 |
+
//$tealium = new $helper($store);
|
5 |
|
6 |
if (!$helper->isEnabled($store)) {
|
7 |
return; // not enabled, no javascript inserted
|
8 |
}
|
|
|
9 |
|
10 |
+
$tealium = $helper->getTealiumObject($store, $this);
|
11 |
+
echo $tealium->render("tag");
|
12 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/tealium_tags/catalog_product_compare_index.phtml
CHANGED
@@ -16,17 +16,18 @@ foreach($this->getItems() as $item) {
|
|
16 |
$skus[] = $item->getSku();
|
17 |
$names[] = $item->getName();
|
18 |
}
|
19 |
-
?>
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
16 |
$skus[] = $item->getSku();
|
17 |
$names[] = $item->getName();
|
18 |
}
|
|
|
19 |
|
20 |
+
$udo = array(
|
21 |
+
page_type => "product compare",
|
22 |
+
product_id => implode('","', $ids),
|
23 |
+
product_sku => implode('","', $skus),
|
24 |
+
product_name => implode('","', $names)
|
25 |
+
);
|
26 |
+
|
27 |
+
|
28 |
+
$tealium = $helper->getTealiumObject($store, $this);
|
29 |
+
$tealium->pageType("Home");
|
30 |
+
$tealium->updateUdo($udo);
|
31 |
+
echo $tealium->render("udo");
|
32 |
+
echo $helper->getDiagnosticTag($store);
|
33 |
+
?>
|
app/design/frontend/base/default/template/tealium_tags/catalogsearch_advanced_result_index.phtml
CHANGED
@@ -23,16 +23,16 @@ if (empty($terms)) {
|
|
23 |
$terms[] = "no-criteria";
|
24 |
}
|
25 |
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
page_type: "advanced search",
|
35 |
-
search_results: "<?php echo $this->getResultCount(); ?>",
|
36 |
-
search_keyword: ["<?php echo implode('","', $terms) ?>"]
|
37 |
-
};
|
38 |
-
</script>
|
23 |
$terms[] = "no-criteria";
|
24 |
}
|
25 |
|
26 |
+
$udo = array(
|
27 |
+
page_name => "advanced search results",
|
28 |
+
page_type => "advanced search",
|
29 |
+
search_results => $this->getResultCount(),
|
30 |
+
search_keyword => implode('","', $terms)
|
31 |
+
);
|
32 |
|
33 |
+
$tealium = $helper->getTealiumObject($store, $this);
|
34 |
+
$tealium->pageType("Search");
|
35 |
+
$tealium->updateUdo($udo);
|
36 |
+
echo $tealium->render("udo");
|
37 |
+
echo $helper->getDiagnosticTag($store);
|
38 |
+
?>
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/tealium_tags/catalogsearch_result_index.phtml
CHANGED
@@ -7,16 +7,8 @@ if (!$helper->isEnabled($store)) {
|
|
7 |
return; // not enabled, no javascript inserted
|
8 |
}
|
9 |
|
|
|
|
|
|
|
|
|
10 |
?>
|
11 |
-
|
12 |
-
<!-- Tealium Search Results page javascript -->
|
13 |
-
<script type="text/javascript">
|
14 |
-
var utag_data={
|
15 |
-
site_region: "<?php echo Mage::app()->getLocale()->getLocaleCode(); ?>",
|
16 |
-
site_currency: "<?php echo $store->getCurrentCurrencyCode(); ?>",
|
17 |
-
page_name: "search results",
|
18 |
-
page_type: "search",
|
19 |
-
search_results: "<?php echo $this->getResultCount(); ?>",
|
20 |
-
search_keyword: ["<?php echo $this->helper('catalogsearch')->getEscapedQueryText(); ?>"]
|
21 |
-
};
|
22 |
-
</script>
|
7 |
return; // not enabled, no javascript inserted
|
8 |
}
|
9 |
|
10 |
+
$tealium = $helper->getTealiumObject($store, $this);
|
11 |
+
$tealium->pageType("Search");
|
12 |
+
echo $tealium->render("udo");
|
13 |
+
echo $helper->getDiagnosticTag($store);
|
14 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/tealium_tags/catalogsearch_term_popular.phtml
CHANGED
@@ -16,15 +16,13 @@ if( sizeof($this->getTerms()) > 0 ) {
|
|
16 |
} else {
|
17 |
$terms[] = "no-terms";
|
18 |
}
|
19 |
-
?>
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
</script>
|
16 |
} else {
|
17 |
$terms[] = "no-terms";
|
18 |
}
|
|
|
19 |
|
20 |
+
|
21 |
+
$tealium = $helper->getTealiumObject($store, $this);
|
22 |
+
$tealium->pageType("Search");
|
23 |
+
$tealium->updateUdo("page_type", "popular search terms");
|
24 |
+
$tealium->updateUdo("page_name", $this->getLayout()->getBlock('head')->getTitle());
|
25 |
+
$tealium->updateUdo("search_keyword", $implode('","', $terms));
|
26 |
+
echo $tealium->render("udo");
|
27 |
+
echo $helper->getDiagnosticTag($store);
|
28 |
+
?>
|
|
app/design/frontend/base/default/template/tealium_tags/category.phtml
CHANGED
@@ -7,47 +7,8 @@ if (!$helper->isEnabled($store)) {
|
|
7 |
return; // not enabled, no javascript inserted
|
8 |
}
|
9 |
|
10 |
-
$
|
11 |
-
$
|
12 |
-
$
|
13 |
-
|
14 |
-
|
15 |
-
if ($_category->getParentId()) {
|
16 |
-
$parent = Mage::getModel('catalog/category')->load($_category->getParentId());
|
17 |
-
|
18 |
-
if ($parent->getParentId()) {
|
19 |
-
$grandparent = Mage::getModel('catalog/category')->load($parent->getParentId());
|
20 |
-
}
|
21 |
-
}
|
22 |
-
|
23 |
-
// Set the section and subcategory with parent and grandparent
|
24 |
-
$section = "n/a";
|
25 |
-
$category = "n/a";
|
26 |
-
$subcategory = "n/a";
|
27 |
-
|
28 |
-
if ($grandparent) {
|
29 |
-
$section = $grandparent->getName();
|
30 |
-
$category = $parent->getName();
|
31 |
-
$subcategory = $_category->getName();
|
32 |
-
} elseif ($parent) {
|
33 |
-
$section = $parent->getName();
|
34 |
-
$category = $_category->getName();
|
35 |
-
} else {
|
36 |
-
$category = $_category->getName();
|
37 |
-
}
|
38 |
-
|
39 |
-
?>
|
40 |
-
|
41 |
-
<!-- Tealium Category javascript -->
|
42 |
-
<script type="text/javascript">
|
43 |
-
var utag_data={
|
44 |
-
site_region: "<?php echo Mage::app()->getLocale()->getLocaleCode(); ?>",
|
45 |
-
site_currency: "<?php echo $store->getCurrentCurrencyCode(); ?>",
|
46 |
-
page_name: "<?php echo $_category->getName(); ?>",
|
47 |
-
page_type: "category",
|
48 |
-
page_section_name: "<?php echo $section; ?>",
|
49 |
-
page_category_name: "<?php echo $category; ?>",
|
50 |
-
page_subcategory_name: "<?php echo $subcategory; ?>"
|
51 |
-
|
52 |
-
};
|
53 |
-
</script>
|
7 |
return; // not enabled, no javascript inserted
|
8 |
}
|
9 |
|
10 |
+
$tealium = $helper->getTealiumObject($store, $this);
|
11 |
+
$tealium->pageType("Category");
|
12 |
+
echo $tealium->render("udo");
|
13 |
+
echo $helper->getDiagnosticTag($store);
|
14 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/tealium_tags/checkout_cart_index.phtml
CHANGED
@@ -1,41 +1,14 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$helper = Mage::helper('tealium_tags');
|
4 |
-
$store = Mage::app()->getStore();
|
5 |
-
|
6 |
-
if (!$helper->isEnabled($store)) {
|
7 |
-
return; // not enabled, no javascript inserted
|
8 |
-
}
|
9 |
-
|
10 |
-
$
|
11 |
-
|
12 |
-
$
|
13 |
-
$
|
14 |
-
|
15 |
-
$qtys = array();
|
16 |
-
$prices = array();
|
17 |
-
|
18 |
-
foreach ($quote->getAllVisibleItems() as $item) {
|
19 |
-
$ids[] = $item->getProductId();
|
20 |
-
$skus[] = $item->getSku();
|
21 |
-
$names[] = $item->getName();
|
22 |
-
$qtys[] = number_format($item->getQty(),0,".","");
|
23 |
-
$prices[] = number_format($item->getPrice(),2,".","");
|
24 |
-
}
|
25 |
-
|
26 |
-
?>
|
27 |
-
|
28 |
-
<!-- Tealium Checkout_Cart javascript -->
|
29 |
-
<script type="text/javascript">
|
30 |
-
var utag_data={
|
31 |
-
site_region: "<?php echo Mage::app()->getLocale()->getLocaleCode(); ?>",
|
32 |
-
site_currency: "<?php echo $store->getCurrentCurrencyCode(); ?>",
|
33 |
-
page_name: "cart index",
|
34 |
-
page_type: "cart",
|
35 |
-
product_id: ["<?php echo implode('","', $ids) ?>"],
|
36 |
-
product_sku: ["<?php echo implode('","', $skus) ?>"],
|
37 |
-
product_name: ["<?php echo implode('","', $names) ?>"],
|
38 |
-
product_quantity: ["<?php echo implode('","', $qtys) ?>"],
|
39 |
-
product_list_price: ["<?php echo implode('","', $prices) ?>"]
|
40 |
-
};
|
41 |
-
</script>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$helper = Mage::helper('tealium_tags');
|
4 |
+
$store = Mage::app()->getStore();
|
5 |
+
|
6 |
+
if (!$helper->isEnabled($store)) {
|
7 |
+
return; // not enabled, no javascript inserted
|
8 |
+
}
|
9 |
+
|
10 |
+
$tealium = $helper->getTealiumObject($store, $this);
|
11 |
+
$tealium->pageType("Cart");
|
12 |
+
echo $tealium->render("udo");
|
13 |
+
echo $helper->getDiagnosticTag($store);
|
14 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/tealium_tags/checkout_onepage.phtml
CHANGED
@@ -1,41 +1,37 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$helper = Mage::helper('tealium_tags');
|
4 |
-
$store = Mage::app()->getStore();
|
5 |
-
|
6 |
-
if (!$helper->isEnabled($store)) {
|
7 |
-
return; // not enabled, no javascript inserted
|
8 |
-
}
|
9 |
-
|
10 |
-
$
|
11 |
-
|
12 |
-
$
|
13 |
-
$
|
14 |
-
$
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
product_quantity: ["<?php echo implode('","', $qtys) ?>"],
|
39 |
-
product_list_price: ["<?php echo implode('","', $prices) ?>"]
|
40 |
-
};
|
41 |
-
</script>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$helper = Mage::helper('tealium_tags');
|
4 |
+
$store = Mage::app()->getStore();
|
5 |
+
|
6 |
+
if (!$helper->isEnabled($store)) {
|
7 |
+
return; // not enabled, no javascript inserted
|
8 |
+
}
|
9 |
+
|
10 |
+
$tealium = $helper->getTealiumObject($store, $this);
|
11 |
+
$tealium->pageType("Cart");
|
12 |
+
echo $tealium->render("udo");
|
13 |
+
echo $helper->getDiagnosticTag($store);
|
14 |
+
$jsonUDO = $tealium->render("json");
|
15 |
+
|
16 |
+
echo <<<EOD
|
17 |
+
<script type="text/javascript">
|
18 |
+
document.addEventListener('DOMContentLoaded',function(){
|
19 |
+
Checkout.prototype.gotoSection = function(section) {
|
20 |
+
utag.data=$jsonUDO;
|
21 |
+
utag.data["page_name"] = section;
|
22 |
+
utag.view(utag.data);
|
23 |
+
section = $('opc-'+section);
|
24 |
+
section.addClassName('allow');
|
25 |
+
this.accordion.openSection(section)
|
26 |
+
}
|
27 |
+
});
|
28 |
+
</script>
|
29 |
+
|
30 |
+
EOD
|
31 |
+
?>
|
32 |
+
|
33 |
+
<script type="text/javascript">
|
34 |
+
document.addEventListener('DOMContentLoaded',function(){
|
35 |
+
review = new Review('<?php echo $this->getUrl('checkout/onepage/saveOrder', array('form_key' => Mage::getSingleton('core/session')->getFormKey())) ?>', '<?php echo $this->getUrl('checkout/onepage/success') ?>', $('checkout-agreements'));
|
36 |
+
});
|
37 |
+
</script>
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/tealium_tags/checkout_success.phtml
CHANGED
@@ -1,73 +1,14 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$helper = Mage::helper('tealium_tags');
|
4 |
-
$store = Mage::app()->getStore();
|
5 |
-
|
6 |
-
if (!$helper->isEnabled($store)) {
|
7 |
-
return; // not enabled, no javascript inserted
|
8 |
-
}
|
9 |
-
|
10 |
-
$
|
11 |
-
|
12 |
-
$
|
13 |
-
$
|
14 |
-
|
15 |
-
$qtys = array();
|
16 |
-
$prices = array();
|
17 |
-
$discounts = array();
|
18 |
-
$discount_quantity = array();
|
19 |
-
|
20 |
-
foreach($order->getAllVisibleItems() as $item) {
|
21 |
-
|
22 |
-
$ids[] = $item->getProductId();
|
23 |
-
$skus[] = $item->getSku();
|
24 |
-
$names[] = $item->getName();
|
25 |
-
$qtys[] = number_format($item->getQtyOrdered(),0,".","");
|
26 |
-
$prices[] = number_format($item->getPrice(),2,".","");
|
27 |
-
$discount = number_format($item->getDiscountAmount(),2,".","");
|
28 |
-
$discounts[] = $discount;
|
29 |
-
$applied_rules = explode(",", $item->getAppliedRuleIds());
|
30 |
-
$discount_object = array();
|
31 |
-
foreach ($applied_rules as $rule) {
|
32 |
-
$quantity = number_format(Mage::getModel('salesrule/rule')->load($rule)->getDiscountQty(),0,".","");
|
33 |
-
$amount = number_format(Mage::getModel('salesrule/rule')->load($rule)->getDiscountAmount(),2,".","");
|
34 |
-
$type = Mage::getModel('salesrule/rule')->load($rule)->getSimpleAction();
|
35 |
-
$discount_object[] = "{\"rule\":\"$rule\",\"quantity\":\"$quantity\",\"amount\":\"$amount\",\"type\":\"$type\"}";
|
36 |
-
}
|
37 |
-
$discount_quantity[] = "{\"product_id\":\"" . $item->getProductId() .
|
38 |
-
"\",\"total_discount\":\"" . $discount .
|
39 |
-
"\", \"discounts\":[" . implode(",",$discount_object) . "]}";
|
40 |
-
|
41 |
-
}
|
42 |
-
|
43 |
-
?>
|
44 |
-
|
45 |
-
<!-- Tealium Checkout Success javascript -->
|
46 |
-
<script type="text/javascript">
|
47 |
-
var utag_data={
|
48 |
-
site_region: "<?php echo Mage::app()->getLocale()->getLocaleCode(); ?>",
|
49 |
-
site_currency: "<?php echo $store->getCurrentCurrencyCode(); ?>",
|
50 |
-
page_name: "cart success",
|
51 |
-
page_type: "cart",
|
52 |
-
product_discount: ["<?php echo implode('","', $discounts) ?>"],
|
53 |
-
product_discounts: [<?php echo implode(",", $discount_quantity) ?>],
|
54 |
-
product_id: ["<?php echo implode('","', $ids) ?>"],
|
55 |
-
product_sku: ["<?php echo implode('","', $skus) ?>"],
|
56 |
-
product_name: ["<?php echo implode('","', $names) ?>"],
|
57 |
-
product_quantity: ["<?php echo implode('","', $qtys) ?>"],
|
58 |
-
product_list_price: ["<?php echo implode('","', $prices) ?>"],
|
59 |
-
order_id: "<?php echo $order->getIncrementId(); ?>",
|
60 |
-
order_subtotal: "<?php echo number_format($order->getSubtotal(),2,".",""); ?>",
|
61 |
-
order_payment_type: "<?php echo $order->getPayment() ? $order->getPayment()->getMethodInstance()->getTitle() : 'unknown'; ?>",
|
62 |
-
order_total: "<?php echo number_format($order->getGrandTotal(),2,".",""); ?>",
|
63 |
-
customer_email: "<?php echo $order->getCustomerEmail(); ?>",
|
64 |
-
order_discount: "<?php echo number_format($order->getDiscountAmount(),2,".",""); ?>",
|
65 |
-
order_shipping: "<?php echo number_format($order->getShippingAmount(),2,".",""); ?>",
|
66 |
-
order_tax: "<?php echo number_format($order->getTaxAmount(),2,".",""); ?>",
|
67 |
-
order_currency: "<?php echo $order->getOrderCurrencyCode(); ?>"
|
68 |
-
};
|
69 |
-
</script>
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$helper = Mage::helper('tealium_tags');
|
4 |
+
$store = Mage::app()->getStore();
|
5 |
+
|
6 |
+
if (!$helper->isEnabled($store)) {
|
7 |
+
return; // not enabled, no javascript inserted
|
8 |
+
}
|
9 |
+
|
10 |
+
$tealium = $helper->getTealiumObject($store, $this);
|
11 |
+
$tealium->pageType("Confirmation");
|
12 |
+
echo $tealium->render("udo");
|
13 |
+
echo $helper->getDiagnosticTag($store);
|
14 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/tealium_tags/cms.phtml
CHANGED
@@ -7,14 +7,8 @@ if (!$helper->isEnabled($store)) {
|
|
7 |
return; // not enabled, no javascript inserted
|
8 |
}
|
9 |
|
|
|
|
|
|
|
|
|
10 |
?>
|
11 |
-
|
12 |
-
<!-- Tealium CMS page javascript -->
|
13 |
-
<script type="text/javascript">
|
14 |
-
var utag_data={
|
15 |
-
site_region: "<?php echo Mage::app()->getLocale()->getLocaleCode(); ?>",
|
16 |
-
site_currency: "<?php echo $store->getCurrentCurrencyCode(); ?>",
|
17 |
-
page_name: "<?php echo $this->getLayout()->getBlock('head')->getTitle(); ?>",
|
18 |
-
page_type: "<?php echo $this->getTealiumType(); ?>"
|
19 |
-
};
|
20 |
-
</script>
|
7 |
return; // not enabled, no javascript inserted
|
8 |
}
|
9 |
|
10 |
+
$tealium = $helper->getTealiumObject($store, $this);
|
11 |
+
$tealium->pageType("Home");
|
12 |
+
echo $tealium->render("udo");
|
13 |
+
echo $helper->getDiagnosticTag($store);
|
14 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/tealium_tags/customer.phtml
CHANGED
@@ -7,28 +7,9 @@ if (!$helper->isEnabled($store)) {
|
|
7 |
return; // not enabled, no javascript inserted
|
8 |
}
|
9 |
|
10 |
-
$customer_id = "n/a";
|
11 |
-
$customer_email = "n/a";
|
12 |
-
$customer_type = "n/a";
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
$customer_type = Mage::getModel('customer/group')->load($groupId)->getCode();
|
20 |
-
}
|
21 |
-
?>
|
22 |
-
|
23 |
-
<!-- Tealium Customer page javascript -->
|
24 |
-
<script type="text/javascript">
|
25 |
-
var utag_data={
|
26 |
-
site_region: "<?php echo Mage::app()->getLocale()->getLocaleCode(); ?>",
|
27 |
-
site_currency: "<?php echo $store->getCurrentCurrencyCode(); ?>",
|
28 |
-
page_name: "<?php echo $this->getLayout()->getBlock('head')->getTitle(); ?>",
|
29 |
-
page_type: "<?php echo $this->getTealiumType(); ?>",
|
30 |
-
customer_id: "<?php echo $customer_id; ?>",
|
31 |
-
customer_email: "<?php echo $customer_email; ?>",
|
32 |
-
customer_type: "<?php echo $customer_type; ?>"
|
33 |
-
};
|
34 |
-
</script>
|
7 |
return; // not enabled, no javascript inserted
|
8 |
}
|
9 |
|
|
|
|
|
|
|
10 |
|
11 |
+
$tealium = $helper->getTealiumObject($store, $this);
|
12 |
+
$tealium->pageType("Customer");
|
13 |
+
echo $tealium->render("udo");
|
14 |
+
echo $helper->getDiagnosticTag($store);
|
15 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/tealium_tags/generic.phtml
CHANGED
@@ -7,14 +7,9 @@ if (!$helper->isEnabled($store)) {
|
|
7 |
return; // not enabled, no javascript inserted
|
8 |
}
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
site_currency: "<?php echo $store->getCurrentCurrencyCode(); ?>",
|
17 |
-
page_name: "<?php echo $this->getLayout()->getBlock('head')->getTitle(); ?>",
|
18 |
-
page_type: "generic"
|
19 |
-
};
|
20 |
-
</script>
|
7 |
return; // not enabled, no javascript inserted
|
8 |
}
|
9 |
|
10 |
+
$tealium = $helper->getTealiumObject($store, $this);
|
11 |
+
$tealium->pageType("Home");
|
12 |
+
$tealium->updateUdo("page_type","generic");
|
13 |
+
echo $tealium->render("udo");
|
14 |
+
echo $helper->getDiagnosticTag($store);
|
15 |
+
?>
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/tealium_tags/guest_sales.phtml
CHANGED
@@ -7,14 +7,9 @@ if (!$helper->isEnabled($store)) {
|
|
7 |
return; // not enabled, no javascript inserted
|
8 |
}
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
site_currency: "<?php echo $store->getCurrentCurrencyCode(); ?>",
|
17 |
-
page_name: "<?php echo $this->getTealiumName(); ?>",
|
18 |
-
page_type: "<?php echo $this->getTealiumType(); ?>"
|
19 |
-
};
|
20 |
-
</script>
|
7 |
return; // not enabled, no javascript inserted
|
8 |
}
|
9 |
|
10 |
+
$tealium = $helper->getTealiumObject($store, $this);
|
11 |
+
$tealium->pageType("Home");
|
12 |
+
$tealium->updateUdo("page_name", $this->getTealiumName());
|
13 |
+
echo $tealium->render("udo");
|
14 |
+
echo $helper->getDiagnosticTag($store);
|
15 |
+
?>
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/tealium_tags/product.phtml
CHANGED
@@ -1,31 +1,18 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$helper = Mage::helper('tealium_tags');
|
4 |
-
$store = Mage::app()->getStore();
|
5 |
-
|
6 |
-
if (!$helper->isEnabled($store)) {
|
7 |
-
return; // not enabled, no javascript inserted
|
8 |
-
}
|
9 |
-
|
10 |
-
$_product = $this->getProduct();
|
11 |
-
$_category = Mage::registry('current_category');
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
site_region: "<?php echo Mage::app()->getLocale()->getLocaleCode(); ?>",
|
20 |
-
site_currency: "<?php echo $store->getCurrentCurrencyCode(); ?>",
|
21 |
-
page_name: "<?php echo $_product->getName(); ?>",
|
22 |
-
page_type: "product",
|
23 |
-
product_id: ["<?php echo $_product->getId(); ?>"],
|
24 |
-
product_sku: ["<?php echo $_product->getSku(); ?>"],
|
25 |
-
product_name: ["<?php echo $_product->getName(); ?>"],
|
26 |
-
product_brand: ["<?php echo $_product->getBrand(); ?>"],
|
27 |
-
product_category: ["<?php echo $_category ? $_category->getName() : 'no_category'; ?>"],
|
28 |
-
<?php if ($_product->getSpecialPrice()!='') echo 'product_unit_price: ["'.number_format($_product->getSpecialPrice(),2) .'"],'; ?>
|
29 |
-
product_list_price: ["<?php echo number_format($_product->getPrice(),2); ?>"]
|
30 |
-
};
|
31 |
-
</script>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$helper = Mage::helper('tealium_tags');
|
4 |
+
$store = Mage::app()->getStore();
|
5 |
+
|
6 |
+
if (!$helper->isEnabled($store)) {
|
7 |
+
return; // not enabled, no javascript inserted
|
8 |
+
}
|
9 |
+
|
10 |
+
$_product = $this->getProduct();
|
11 |
+
$_category = Mage::registry('current_category');
|
12 |
+
|
13 |
+
|
14 |
+
$tealium = $helper->getTealiumObject($store, $this);
|
15 |
+
$tealium->pageType("ProductPage");
|
16 |
+
echo $tealium->render("udo");
|
17 |
+
echo $helper->getDiagnosticTag($store);
|
18 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/tealium_tags/product_send.phtml
CHANGED
@@ -1,32 +1,34 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$helper = Mage::helper('tealium_tags');
|
4 |
-
$store = Mage::app()->getStore();
|
5 |
-
|
6 |
-
if (!$helper->isEnabled($store)) {
|
7 |
-
return; // not enabled, no javascript inserted
|
8 |
-
}
|
9 |
-
|
10 |
-
$_product_id = $this->getProductId();
|
11 |
-
$_category_id = $this->getCategoryId();
|
12 |
-
|
13 |
-
$_product = Mage::getModel('catalog/product')->load($_product_id)
|
14 |
-
$_category = Mage::getModel('catalog/category')->load($_category_id)
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$helper = Mage::helper('tealium_tags');
|
4 |
+
$store = Mage::app()->getStore();
|
5 |
+
|
6 |
+
if (!$helper->isEnabled($store)) {
|
7 |
+
return; // not enabled, no javascript inserted
|
8 |
+
}
|
9 |
+
|
10 |
+
$_product_id = $this->getProductId();
|
11 |
+
$_category_id = $this->getCategoryId();
|
12 |
+
|
13 |
+
$_product = Mage::getModel('catalog/product')->load($_product_id);
|
14 |
+
$_category = Mage::getModel('catalog/category')->load($_category_id);
|
15 |
+
|
16 |
+
$udo = array(
|
17 |
+
page_name => $_product->getName(),
|
18 |
+
page_type => "product send",
|
19 |
+
product_id => $_product->getId(),
|
20 |
+
product_sku => $_product->getSku(),
|
21 |
+
product_name => $_product->getName(),
|
22 |
+
product_brand => $_product->getBrand(),
|
23 |
+
product_category => $_category ? $_category->getName() : 'no_category',
|
24 |
+
product_unit_price => number_format($_product->getSpecialPrice()?:"",2,""),
|
25 |
+
product_list_price => number_format($_product->getPrice()?:"",2,"")
|
26 |
+
);
|
27 |
+
|
28 |
+
|
29 |
+
$tealium = $helper->getTealiumObject($store, $this);
|
30 |
+
$tealium->pageType("ProductPage");
|
31 |
+
$tealium->updateUdo($udo);
|
32 |
+
echo $tealium->render("udo");
|
33 |
+
echo $helper->getDiagnosticTag($store);
|
34 |
+
?>
|
app/design/frontend/base/default/template/tealium_tags/seo.phtml
CHANGED
@@ -7,14 +7,8 @@ if (!$helper->isEnabled($store)) {
|
|
7 |
return; // not enabled, no javascript inserted
|
8 |
}
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
site_region: "<?php echo Mage::app()->getLocale()->getLocaleCode(); ?>",
|
16 |
-
site_currency: "<?php echo $store->getCurrentCurrencyCode(); ?>",
|
17 |
-
page_name: "<?php echo $this->getLayout()->getBlock('head')->getTitle(); ?>",
|
18 |
-
page_type: "<?php echo $this->getTealiumType(); ?>"
|
19 |
-
};
|
20 |
-
</script>
|
7 |
return; // not enabled, no javascript inserted
|
8 |
}
|
9 |
|
10 |
+
$tealium = $helper->getTealiumObject($store, $this);
|
11 |
+
$tealium->pageType("Home");
|
12 |
+
echo $tealium->render("udo");
|
13 |
+
echo $helper->getDiagnosticTag($store);
|
14 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/tealium_tags/tag_list_index.phtml
CHANGED
@@ -16,15 +16,12 @@ if( sizeof($this->getTags()) > 0 ) {
|
|
16 |
} else {
|
17 |
$tags[] = "no-tags";
|
18 |
}
|
19 |
-
?>
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
};
|
30 |
-
</script>
|
16 |
} else {
|
17 |
$tags[] = "no-tags";
|
18 |
}
|
|
|
19 |
|
20 |
+
$tealium = $helper->getTealiumObject($store, $this);
|
21 |
+
$tealium->pageType("Search");
|
22 |
+
$tealium->updateUdo("page_type", "tag list");
|
23 |
+
$tealium->updateUdo("page_name", $this->getLayout()->getBlock('head')->getTitle());
|
24 |
+
$tealium->updateUdo("search_keyword", $implode('","', $tags));
|
25 |
+
echo $tealium->render("udo");
|
26 |
+
echo $helper->getDiagnosticTag($store);
|
27 |
+
?>
|
|
|
|
app/design/frontend/base/default/template/tealium_tags/tag_product_list.phtml
CHANGED
@@ -7,16 +7,10 @@ if (!$helper->isEnabled($store)) {
|
|
7 |
return; // not enabled, no javascript inserted
|
8 |
}
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
page_name: "<?php echo $this->getLayout()->getBlock('head')->getTitle(); ?>",
|
18 |
-
page_type: "tag product list",
|
19 |
-
search_results: "<?php echo $this->getResultCount(); ?>",
|
20 |
-
search_keyword: ["<?php echo $this->getTag()->getName(); ?>"]
|
21 |
-
};
|
22 |
-
</script>
|
7 |
return; // not enabled, no javascript inserted
|
8 |
}
|
9 |
|
10 |
+
$tealium = $helper->getTealiumObject($store, $this);
|
11 |
+
$tealium->pageType("Search");
|
12 |
+
$tealium->updateUdo("page_type", "tag product list");
|
13 |
+
$tealium->updateUdo("page_name", $this->getLayout()->getBlock('head')->getTitle());
|
14 |
+
echo $tealium->render("udo");
|
15 |
+
echo $helper->getDiagnosticTag($store);
|
16 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tealium/Tealium.php
ADDED
@@ -0,0 +1,256 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php // Tealium.php Class file
|
2 |
+
// This interface describes the methods available for the class object and usage
|
3 |
+
interface TealiumInterface {
|
4 |
+
public function updateUdo($objectOrKey, $value);
|
5 |
+
// update only part of the UDO currently set in object
|
6 |
+
// $tealium->updateUdo($objectOrKey, $value)
|
7 |
+
// to update multiple values: $tealium->updateUDO(array(key1=>"value1", key2=>"value2",...))
|
8 |
+
// to update one value: $tealium->updateUDO("key", "value")
|
9 |
+
//
|
10 |
+
// to update a specific page in the UDO object: $tealium->updateUDO("key", "value", PAGE_TYPE);
|
11 |
+
// to update a specific page in the UDO object: $tealium->updateUDO(array(key1=>"value1", key2=>"value2",...), null, PAGE_TYPE);
|
12 |
+
|
13 |
+
public function pageType($pageType);
|
14 |
+
// Set page type for udo to render: $tealium->pageType("Home")
|
15 |
+
|
16 |
+
public function render();
|
17 |
+
// return UDO and async utag.js call in HTML format
|
18 |
+
// print $tealium->render();
|
19 |
+
// alernate: print $tealium;
|
20 |
+
//
|
21 |
+
// to print only tag: print $tealium->render("tag");
|
22 |
+
// to print only UDO: print $tealium->render("udo");
|
23 |
+
// to print only json object: print $tealium->render("json");
|
24 |
+
|
25 |
+
}
|
26 |
+
class Tealium implements TealiumInterface
|
27 |
+
|
28 |
+
{
|
29 |
+
private $account, $profile, $target, $udo, $access;
|
30 |
+
public function __construct($accountInit = false, $profileInit = false, $targetInit = false, $pageType = "Home", $data = array(
|
31 |
+
)) {
|
32 |
+
$this->access = array(
|
33 |
+
account => array(
|
34 |
+
type => "string",
|
35 |
+
read => true,
|
36 |
+
write => false
|
37 |
+
) ,
|
38 |
+
profile => array(
|
39 |
+
type => "string",
|
40 |
+
read => true,
|
41 |
+
write => false
|
42 |
+
) ,
|
43 |
+
target => array(
|
44 |
+
type => "string",
|
45 |
+
read => true,
|
46 |
+
write => false
|
47 |
+
) ,
|
48 |
+
udo => array(
|
49 |
+
type => "array",
|
50 |
+
read => true,
|
51 |
+
write => false
|
52 |
+
),
|
53 |
+
access => array(
|
54 |
+
type => "array",
|
55 |
+
read => false,
|
56 |
+
write => false
|
57 |
+
)
|
58 |
+
);
|
59 |
+
require 'TealiumInit.php';
|
60 |
+
|
61 |
+
$this->udoElements = $udoElements;
|
62 |
+
$this->account = $accountInit;
|
63 |
+
$this->profile = $profileInit;
|
64 |
+
$this->target = $targetInit;
|
65 |
+
$this->udo = $this->udoElements[$pageType] ? : ($pageType == null ? $pageType : array(
|
66 |
+
page_type => $pageType
|
67 |
+
));
|
68 |
+
}
|
69 |
+
public function __toString() {
|
70 |
+
return $this->render();
|
71 |
+
}
|
72 |
+
public function __call($name, $arguments) {
|
73 |
+
if ($this->{$name}){
|
74 |
+
return false;
|
75 |
+
}
|
76 |
+
if ($udoElements[$name]) {
|
77 |
+
$newUdo = array_shift($arguments);
|
78 |
+
$this->$udo = ($newUdo) ? : $udoElements[$name];
|
79 |
+
}
|
80 |
+
else {
|
81 |
+
$newUdo = array_shift($arguments);
|
82 |
+
$this->$udo = ($newUdo) ? : array();
|
83 |
+
}
|
84 |
+
return $this->render();
|
85 |
+
}
|
86 |
+
public function __set($name, $value){
|
87 |
+
if(!$this->{$name}){
|
88 |
+
$this->{$name} = $value;
|
89 |
+
}
|
90 |
+
elseif($this->{$name} && $this->access[$name]){
|
91 |
+
if($this->access[$name]['write']){
|
92 |
+
settype($value, $this->access[$name]['type']);
|
93 |
+
$this->{$name} = $value;
|
94 |
+
}
|
95 |
+
}
|
96 |
+
elseif($this->{$name}) {
|
97 |
+
$this->{$name} = $value;
|
98 |
+
}
|
99 |
+
}
|
100 |
+
public function __get($name) {
|
101 |
+
if ($this->{$name} && $this->access[$name]) {
|
102 |
+
if ($this->access[$name]['read']){
|
103 |
+
return (gettype($this->{$name}) == "array") ? json_encode($this->udo, JSON_PRETTY_PRINT) : $this->{$name};
|
104 |
+
}
|
105 |
+
else {
|
106 |
+
return "[private]";
|
107 |
+
}
|
108 |
+
}
|
109 |
+
elseif($this->{$name}) {
|
110 |
+
return $this->{$name};
|
111 |
+
}
|
112 |
+
elseif(!$this->{$name}) {
|
113 |
+
return "no value set for property: $name";
|
114 |
+
}
|
115 |
+
}
|
116 |
+
public function updateUdo($objectOrKey = "", $value = "", $pageType = null) {
|
117 |
+
if (is_array($objectOrKey)) {
|
118 |
+
foreach($objectOrKey as $key => $value) {
|
119 |
+
if (!$pageType) {
|
120 |
+
$this->udo[$key] = $value;
|
121 |
+
}
|
122 |
+
else {
|
123 |
+
$this->udoElements[$pageType][$key] = $value;
|
124 |
+
}
|
125 |
+
}
|
126 |
+
}
|
127 |
+
elseif ($objectOrKey != "") {
|
128 |
+
if (!$pageType) {
|
129 |
+
$this->udo[$objectOrKey] = $value;
|
130 |
+
}
|
131 |
+
else {
|
132 |
+
$this->udoElements[$pageType][$objectOrKey] = $value;
|
133 |
+
}
|
134 |
+
}
|
135 |
+
return $this->udo;
|
136 |
+
}
|
137 |
+
public function pageType($pageType = "Home") {
|
138 |
+
$this->udo = $this->udoElements[$pageType] ? : array(
|
139 |
+
page_type => $pageType
|
140 |
+
);
|
141 |
+
}
|
142 |
+
public function render($type = null) {
|
143 |
+
// Basic JSON object of all variables in the default data layer`
|
144 |
+
$udoString = json_encode($this->udo);
|
145 |
+
// Render UDO object in javaScript
|
146 |
+
$udo = <<<EOD
|
147 |
+
<!-- Tealium Universal Data Object / Data Layer -->
|
148 |
+
<script type="text/javascript">
|
149 |
+
utag_data = $udoString;
|
150 |
+
</script>
|
151 |
+
<!-- ****************************************** -->
|
152 |
+
EOD;
|
153 |
+
// Render Tealium tag in javaScript
|
154 |
+
$tag = <<<EOD
|
155 |
+
<!-- Async Load of Tealium utag.js library -->
|
156 |
+
<script type="text/javascript">
|
157 |
+
(function(a,b,c,d){
|
158 |
+
a='//tags.tiqcdn.com/utag/$this->account/$this->profile/$this->target/utag.js';
|
159 |
+
b=document;c='script';d=b.createElement(c);d.src=a;d.type='text/java'+c;d.
|
160 |
+
async=true;
|
161 |
+
a=b.getElementsByTagName(c)[0];a.parentNode.insertBefore(d,a);
|
162 |
+
})();
|
163 |
+
</script>
|
164 |
+
<!-- ************************************* -->
|
165 |
+
EOD;
|
166 |
+
// Determine what code to return
|
167 |
+
if ($this->account && $this->profile && $this->target) {
|
168 |
+
if ($type == "tag") {
|
169 |
+
$renderedCode = $tag;
|
170 |
+
}
|
171 |
+
elseif ($type == "udo") {
|
172 |
+
$renderedCode = $udo;
|
173 |
+
}
|
174 |
+
elseif ($type == "json") {
|
175 |
+
$renderedCode = $udoString;
|
176 |
+
}
|
177 |
+
else {
|
178 |
+
$renderedCode = $udo . "\n" . $tag;
|
179 |
+
}
|
180 |
+
}
|
181 |
+
else {
|
182 |
+
if ($this->udo != null) {
|
183 |
+
$renderedCode = $udo;
|
184 |
+
}
|
185 |
+
else {
|
186 |
+
// Render instructions if Tealium Object was not used correctly
|
187 |
+
$renderedCode = <<<EOD
|
188 |
+
<!-- Tealium Universal Data Object / Data Layer -->
|
189 |
+
<!-- Account, profile, or environment was not declared in
|
190 |
+
object Tealium(\$account, \$profile, \$target, \$pageType) -->
|
191 |
+
EOD;
|
192 |
+
}
|
193 |
+
}
|
194 |
+
return $renderedCode;
|
195 |
+
}
|
196 |
+
}
|
197 |
+
// Open source alternative for json_encode for PHP < 5.4 ***********************************************
|
198 |
+
if (!function_exists('json_encode')) {
|
199 |
+
function json_encode($a = false)
|
200 |
+
{
|
201 |
+
if (is_null($a)) return 'null';
|
202 |
+
if ($a === false) return 'false';
|
203 |
+
if ($a === true) return 'true';
|
204 |
+
if (is_scalar($a)) {
|
205 |
+
if (is_float($a)) {
|
206 |
+
// Always use "." for floats.
|
207 |
+
return floatval(str_replace(",", ".", strval($a)));
|
208 |
+
}
|
209 |
+
if (is_string($a)) {
|
210 |
+
static $jsonReplaces = array(
|
211 |
+
array(
|
212 |
+
"\\",
|
213 |
+
"/",
|
214 |
+
"\n",
|
215 |
+
"\t",
|
216 |
+
"\r",
|
217 |
+
"\b",
|
218 |
+
"\f",
|
219 |
+
'"'
|
220 |
+
) ,
|
221 |
+
array(
|
222 |
+
'\\\\',
|
223 |
+
'\\/',
|
224 |
+
'\\n',
|
225 |
+
'\\t',
|
226 |
+
'\\r',
|
227 |
+
'\\b',
|
228 |
+
'\\f',
|
229 |
+
'\"'
|
230 |
+
)
|
231 |
+
);
|
232 |
+
return '"' . str_replace($jsonReplaces[0], $jsonReplaces[1], $a) . '"';
|
233 |
+
}
|
234 |
+
else return $a;
|
235 |
+
}
|
236 |
+
$isList = true;
|
237 |
+
for ($i = 0, reset($a); $i < count($a); $i++, next($a)) {
|
238 |
+
if (key($a) !== $i) {
|
239 |
+
$isList = false;
|
240 |
+
break;
|
241 |
+
}
|
242 |
+
}
|
243 |
+
$result = array();
|
244 |
+
if ($isList) {
|
245 |
+
foreach($a as $v) $result[] = json_encode($v);
|
246 |
+
return '[' . join(',', $result) . ']';
|
247 |
+
}
|
248 |
+
else {
|
249 |
+
foreach($a as $k => $v) $result[] = json_encode($k) . ':' . json_encode($v);
|
250 |
+
return '{' . join(',', $result) . '}';
|
251 |
+
}
|
252 |
+
}
|
253 |
+
}
|
254 |
+
// ***********************************************************************************************************
|
255 |
+
|
256 |
+
?>
|
lib/Tealium/TealiumAPI.php
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
include 'Tealium.php';
|
3 |
+
|
4 |
+
// Each action corresponds to a method and renders accordingly.
|
5 |
+
// if attempting to use an action not defined in this array it will display the help output
|
6 |
+
// as long as "help => true" is set, "help => false" will only return "action not found"
|
7 |
+
|
8 |
+
$actions = array(
|
9 |
+
render => true,
|
10 |
+
tag => true,
|
11 |
+
udo => true,
|
12 |
+
help => true
|
13 |
+
); // setting any of these to false will disable that action
|
14 |
+
|
15 |
+
$action = ($_REQUEST['action'] && preg_match('/[.\-\w\d]+/',$_REQUEST['action'])) ? $_REQUEST['action'] : "help";
|
16 |
+
$account = ($_REQUEST['account'] && preg_match('/[.\-\w\d]+/',$_REQUEST['account'])) ? $_REQUEST['account'] : false;
|
17 |
+
$profile = ($_REQUEST['profile'] && preg_match('/[.\-\w\d]+/',$_REQUEST['profile'])) ? $_REQUEST['profile'] : false;
|
18 |
+
$target = ($_REQUEST['target'] && preg_match('/[.\-\w\d]+/',$_REQUEST['target'])) ? $_REQUEST['target'] : false;
|
19 |
+
$pageType = ($_REQUEST['page_type'] && preg_match('/[.\-\w\d]+/',$_REQUEST['page_type'])) ? $_REQUEST['page_type'] : "Home";
|
20 |
+
echo $action;
|
21 |
+
if ($actions[$action]) {
|
22 |
+
header('Content-type: text/html');
|
23 |
+
$action();
|
24 |
+
}
|
25 |
+
else {
|
26 |
+
header('Content-type: text/html');
|
27 |
+
if ($action['help']){
|
28 |
+
help();
|
29 |
+
}
|
30 |
+
else {
|
31 |
+
echo "action not found";
|
32 |
+
}
|
33 |
+
}
|
34 |
+
function render()
|
35 |
+
{
|
36 |
+
global $account, $profile, $target, $pageType;
|
37 |
+
$tealium = new Tealium($account, $profile, $target, $pageType);
|
38 |
+
echo $tealium;
|
39 |
+
}
|
40 |
+
function tag()
|
41 |
+
{
|
42 |
+
global $account, $profile, $target;
|
43 |
+
$tealium = new Tealium($account, $profile, $target, null);
|
44 |
+
echo $tealium;
|
45 |
+
}
|
46 |
+
function udo()
|
47 |
+
{
|
48 |
+
global $pageType;
|
49 |
+
$tealium = new Tealium(null, null, null, $pageType);
|
50 |
+
echo $tealium->udo;
|
51 |
+
}
|
52 |
+
function help()
|
53 |
+
{
|
54 |
+
echo <<<EOD
|
55 |
+
<!-- Tealium not implemented correctly
|
56 |
+
send GET/POST with following parameters:
|
57 |
+
action:
|
58 |
+
render -> will return UDO and async tag - requires account,profile,target,page_type -,
|
59 |
+
tag -> will return async tag only - requires account,profile,target -,
|
60 |
+
udo -> will reyrn UDO only - requires page_type -,
|
61 |
+
|
62 |
+
acount: name of tealium account (.-A-Z1-10),
|
63 |
+
profile: name of tealium profile (.-A-Z1-10),
|
64 |
+
target: target environment [dev,qa,prod,custom] (.-A-Z1-10)
|
65 |
+
page_type: UDO page_type to return [Home, Search, Category, ...] (.-A-Z1-10)
|
66 |
+
-->
|
67 |
+
|
68 |
+
EOD;
|
69 |
+
}
|
70 |
+
?>
|
lib/Tealium/TealiumInit.php
ADDED
@@ -0,0 +1,239 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// TealiumInit.php var definition file
|
3 |
+
// Replace $STRING or $ARRAY with your server side variable reference unique to that key
|
4 |
+
$store = $data["store"];
|
5 |
+
$page = $data["page"];
|
6 |
+
|
7 |
+
|
8 |
+
//define variables from magento *************************************************************************
|
9 |
+
$customer_id = "n/a";
|
10 |
+
$customer_email = "n/a";
|
11 |
+
$customer_type = "n/a";
|
12 |
+
$ids = array();
|
13 |
+
$skus = array();
|
14 |
+
$names = array();
|
15 |
+
$qtys = array();
|
16 |
+
$prices = array();
|
17 |
+
$discounts = array();
|
18 |
+
$discount_quantity = array();
|
19 |
+
$checkout_ids = array();
|
20 |
+
$checkout_skus = array();
|
21 |
+
$checkout_names = array();
|
22 |
+
$checkout_qtys = array();
|
23 |
+
$checkout_prices = array();
|
24 |
+
$section = "n/a";
|
25 |
+
$category = "n/a";
|
26 |
+
$subcategory = "n/a";
|
27 |
+
$_category = null;
|
28 |
+
|
29 |
+
if ($page->getCurrentCategory()) {
|
30 |
+
$_category = $page->getCurrentCategory();
|
31 |
+
$parent = false;
|
32 |
+
$grandparent = false;
|
33 |
+
|
34 |
+
// check for parent and grandparent
|
35 |
+
if ($_category->getParentId()) {
|
36 |
+
$parent = Mage::getModel('catalog/category')->load($_category->getParentId());
|
37 |
+
|
38 |
+
if ($parent->getParentId()) {
|
39 |
+
$grandparent = Mage::getModel('catalog/category')->load($parent->getParentId());
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
// Set the section and subcategory with parent and grandparent
|
44 |
+
if ($grandparent) {
|
45 |
+
$section = $grandparent->getName();
|
46 |
+
$category = $parent->getName();
|
47 |
+
$subcategory = $_category->getName();
|
48 |
+
} elseif ($parent) {
|
49 |
+
$section = $parent->getName();
|
50 |
+
$category = $_category->getName();
|
51 |
+
} else {
|
52 |
+
$category = $_category->getName();
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
if (Mage::helper('checkout')) {
|
57 |
+
$quote = Mage::helper('checkout')->getQuote();
|
58 |
+
foreach ($quote->getAllVisibleItems() as $item) {
|
59 |
+
$checkout_ids[] = $item->getProductId();
|
60 |
+
$checkout_skus[] = $item->getSku();
|
61 |
+
$checkout_names[] = $item->getName();
|
62 |
+
$checkout_qtys[] = number_format($item->getQty(), 0, ".", "");
|
63 |
+
$checkout_prices[] = number_format($item->getPrice(), 2, ".", "");
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
68 |
+
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
69 |
+
$customer_id = $customer->getEntityId();
|
70 |
+
$customer_email = $customer->getEmail();
|
71 |
+
$groupId = $customer->getGroupId();
|
72 |
+
$customer_type = Mage::getModel('customer/group')->load($groupId)->getCode();
|
73 |
+
}
|
74 |
+
|
75 |
+
if (Mage::getModel('sales/order')) {
|
76 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($page->getOrderId());
|
77 |
+
foreach ($order->getAllVisibleItems() as $item) {
|
78 |
+
|
79 |
+
$ids[] = $item->getProductId();
|
80 |
+
$skus[] = $item->getSku();
|
81 |
+
$names[] = $item->getName();
|
82 |
+
$qtys[] = number_format($item->getQtyOrdered(), 0, ".", "");
|
83 |
+
$prices[] = number_format($item->getPrice(), 2, ".", "");
|
84 |
+
$discount = number_format($item->getDiscountAmount(), 2, ".", "");
|
85 |
+
$discounts[] = $discount;
|
86 |
+
$applied_rules = explode(",", $item->getAppliedRuleIds());
|
87 |
+
$discount_object = array();
|
88 |
+
foreach ($applied_rules as $rule) {
|
89 |
+
$quantity = number_format(Mage::getModel('salesrule/rule')->load($rule)->getDiscountQty(), 0, ".", "");
|
90 |
+
$amount = number_format(Mage::getModel('salesrule/rule')->load($rule)->getDiscountAmount(), 2, ".", "");
|
91 |
+
$type = Mage::getModel('salesrule/rule')->load($rule)->getSimpleAction();
|
92 |
+
$discount_object[] = array("rule" =>$rule,
|
93 |
+
"quantity" =>$quantity,
|
94 |
+
"amount" =>$amount,
|
95 |
+
"type" =>$type);
|
96 |
+
}
|
97 |
+
$discount_quantity[] = array("product_id" => $item->getProductId(),
|
98 |
+
"total_discount" => $discount,
|
99 |
+
"discounts" => $discount_object);
|
100 |
+
|
101 |
+
}
|
102 |
+
}
|
103 |
+
//**************************************************************************************************
|
104 |
+
|
105 |
+
$udoElements = array(
|
106 |
+
Home => array(
|
107 |
+
site_region => Mage::app()->getLocale()->getLocaleCode() ?: "", //"uk"
|
108 |
+
site_currency => $store->getCurrentCurrencyCode() ?: "", //"GBP"
|
109 |
+
page_name => $page->getLayout()->getBlock('head')->getTitle() ?: "", //"Home"
|
110 |
+
page_type => $page->getTealiumType() ?: "" //"home"
|
111 |
+
),
|
112 |
+
Search => array(
|
113 |
+
site_region => Mage::app()->getLocale()->getLocaleCode() ?: "", //"uk"
|
114 |
+
site_currency => $store->getCurrentCurrencyCode() ?: "", //"GBP"
|
115 |
+
page_name => "search results", //"results"
|
116 |
+
page_type => "search", //"search"
|
117 |
+
search_results => $page->getResultCount() ?: "", //"234"
|
118 |
+
search_keyword => $page->helper('catalogsearch')->getEscapedQueryText() ?: "" //"shorts"
|
119 |
+
),
|
120 |
+
Category => array(
|
121 |
+
site_region => Mage::app()->getLocale()->getLocaleCode() ?: "", //"uk",
|
122 |
+
site_currency => $store->getCurrentCurrencyCode() ?: "", //"GBP",
|
123 |
+
page_name => $_category ? ($_category->getName() ?: "") : "", //"shorts",
|
124 |
+
page_type => "category", //"category",
|
125 |
+
page_section_name => $section ?: "", //"Men's",
|
126 |
+
page_category_name => $category ?: "", //"Clothing",
|
127 |
+
page_subcategory_name => $subcategory ?: "" //"Shorts"
|
128 |
+
),
|
129 |
+
ProductPage => array(
|
130 |
+
site_region => Mage::app()->getLocale()->getLocaleCode() ?: "", //"uk",
|
131 |
+
site_currency => $store->getCurrentCurrencyCode() ?: "", //"GBP",
|
132 |
+
page_name => $page->getProduct() ? ($page->getProduct()->getName() ?: "") : "", //"Dr. Denim Chase Check Cargo Short",
|
133 |
+
page_type => "product", //"product",
|
134 |
+
page_section_name => $STRING ?: "", //"Men's",
|
135 |
+
page_category_name => $STRING ?: "", //"Clothing",
|
136 |
+
page_subcategory_name => $STRING ?: "", //"Shorts",
|
137 |
+
// THE FOLLOWING NEEDS TO BE MATCHED ARRAYS (SAME NUMBER OF ELEMENTS)
|
138 |
+
product_id => $page->getProduct() ? (array(
|
139 |
+
$page->getProduct()->getId()
|
140 |
+
) ?: array(
|
141 |
+
""
|
142 |
+
)) : array(
|
143 |
+
""
|
144 |
+
), //array("5225415241111"),
|
145 |
+
product_sku => $page->getProduct() ? (array(
|
146 |
+
$page->getProduct()->getSku()
|
147 |
+
) ?: array(
|
148 |
+
""
|
149 |
+
)) : array(
|
150 |
+
""
|
151 |
+
), //array("42526"),
|
152 |
+
product_name => $page->getProduct() ? (array(
|
153 |
+
$page->getProduct()->getName()
|
154 |
+
) ?: array(
|
155 |
+
""
|
156 |
+
)) : array(
|
157 |
+
""
|
158 |
+
), //array("Dr. Denim Chase Check Cargo Short"),
|
159 |
+
product_brand => $page->getProduct() ? (array(
|
160 |
+
$page->getProduct()->getBrand()
|
161 |
+
) ?: array(
|
162 |
+
""
|
163 |
+
)) : array(
|
164 |
+
""
|
165 |
+
), //array("Dr. Denim"),
|
166 |
+
product_category => array(
|
167 |
+
Mage::registry('current_category') ? Mage::registry('current_category')->getName() : 'no_category'
|
168 |
+
) ?: array(
|
169 |
+
""
|
170 |
+
), //array("Shorts"),
|
171 |
+
product_unit_price => $page->getProduct() ? (array(
|
172 |
+
number_format($page->getProduct()->getSpecialPrice(), 2)
|
173 |
+
) ?: array(
|
174 |
+
""
|
175 |
+
)) : array(
|
176 |
+
""
|
177 |
+
), //array("11.99"),
|
178 |
+
product_list_price => $page->getProduct() ? (array(
|
179 |
+
number_format($page->getProduct()->getPrice(), 2)
|
180 |
+
) ?: array(
|
181 |
+
""
|
182 |
+
)) : array(
|
183 |
+
""
|
184 |
+
) //array("59.00")
|
185 |
+
),
|
186 |
+
Cart => array(
|
187 |
+
site_region => Mage::app()->getLocale()->getLocaleCode() ?: "", //"uk",
|
188 |
+
site_currency => $store->getCurrentCurrencyCode() ?: "", //"GBP",
|
189 |
+
page_name => $page->getLayout()->getBlock('head')->getTitle() ?: "", //"cart",
|
190 |
+
page_type => "checkout", //"checkout",
|
191 |
+
// THE FOLLOWING NEEDS TO BE MATCHED ARRAYS (SAME NUMBER OF ELEMENTS)
|
192 |
+
product_id => $checkout_ids ?: array(), //array("5225415241111","5421423520051"),
|
193 |
+
product_sku => $checkout_skus ?: array(), //array("42526","24672"),
|
194 |
+
product_name => $checkout_names ?: array(), //array("Dr. Denim Chase Check Cargo Short","Renewal Denim Shirt"),
|
195 |
+
product_brand => $ARRAY ?: array(), //array("Dr. Denim",""),
|
196 |
+
product_category => $ARRAY ?: array(), //array("Shorts","Shirts"),
|
197 |
+
product_quantity => $checkout_qtys ?: array(), //array("1","1"),
|
198 |
+
product_unit_price => $ARRAY ?: array(), //array("1//array("11.99","37.00"),
|
199 |
+
product_list_price => $checkout_prices ?: array() //array("59.00","")
|
200 |
+
),
|
201 |
+
Confirmation => array(
|
202 |
+
site_region => Mage::app()->getLocale()->getLocaleCode() ?: "", //"uk",
|
203 |
+
site_currency => $store->getCurrentCurrencyCode() ?: "", //"GBP",
|
204 |
+
page_name => "cart success", //"confirmation",
|
205 |
+
page_type => "cart", //"checkout",
|
206 |
+
order_id => $order->getIncrementId() ?: "", //"12345678",
|
207 |
+
order_discount => number_format($order->getDiscountAmount(), 2, ".", "") ?: "", //"0.00",
|
208 |
+
order_subtotal => number_format($order->getSubtotal(), 2, ".", "") ?: "", //"70.99",
|
209 |
+
order_shipping => number_format($order->getShippingAmount(), 2, ".", "") ?: "", //"10.00",
|
210 |
+
order_tax => number_format($order->getTaxAmount(), 2, ".", "") ?: "", //"5.00",
|
211 |
+
order_payment_type => $order->getPayment() ? $order->getPayment()->getMethodInstance()->getTitle() : 'unknown', //"visa",
|
212 |
+
order_total => number_format($order->getGrandTotal(), 2, ".", "") ?: "", //"85.99",
|
213 |
+
order_currency => $order->getOrderCurrencyCode() ?: "", //"gbp",
|
214 |
+
customer_id => $customer_id ?: "", //"12345678",
|
215 |
+
customer_email => $order->getCustomerEmail() ?: "", //"customer@email.com"
|
216 |
+
// THE FOLLOWING NEEDS TO BE MATCHED ARRAYS (SAME NUMBER OF ELEMENTS)
|
217 |
+
product_id => $ids ?: array(), //array("5225415241111","5421423520051"),
|
218 |
+
product_sku => $skus ?: array(), //array("42526","24672"),
|
219 |
+
product_name => $names ?: array(), //array("Dr. Denim Chase Check Cargo Short","Renewal Denim Shirt"),
|
220 |
+
product_brand => $ARRAY ?: array(), //array("Dr. Denim",""),
|
221 |
+
product_category => $ARRAY ?: array(), //array("Shorts","Shirts"),
|
222 |
+
product_unit_price => $ARRAY ?: array(), //array("11.99","37.00"),
|
223 |
+
product_list_price => $prices ?: array(), //array("59.00",""),
|
224 |
+
product_quantity => $qtys ?: array(), //array("1","1"),
|
225 |
+
product_discount => $discounts ?: array(), //array("0.00","0.00"),
|
226 |
+
product_discounts => $discount_quantity ?: array()
|
227 |
+
),
|
228 |
+
Customer => array(
|
229 |
+
site_region => Mage::app()->getLocale()->getLocaleCode() ?: "",
|
230 |
+
site_currency => $store->getCurrentCurrencyCode() ?: "",
|
231 |
+
page_name => $page->getLayout()->getBlock('head')->getTitle() ?: "",
|
232 |
+
page_type => $page->getTealiumType() ?: "",
|
233 |
+
customer_id => $customer_id ?: "",
|
234 |
+
customer_email => $customer_email ?: "",
|
235 |
+
customer_type => $customer_type ?: ""
|
236 |
+
)
|
237 |
+
);
|
238 |
+
|
239 |
+
?>
|
package.xml
CHANGED
@@ -1,14 +1,20 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Tealium_Tags</name>
|
4 |
-
<version>0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Tealum tag management solution</summary>
|
10 |
<description>Tealum tag management solution extension injects the Tealium javascript into your magento pages, and on specific pages injects special javascript so that you can access specific data elements such as product, category or cart data.</description>
|
11 |
-
<notes>0.
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
0.4.3 - fix for bad array on order page
|
13 |
0.4.2 - added simple discount array
|
14 |
0.4.0 - fix for individual discounts and number formats
|
@@ -17,9 +23,9 @@
|
|
17 |
0.2.0 - fix for product page tag syntax
|
18 |
0.1.0 - initial release</notes>
|
19 |
<authors><author><name>Tealium</name><user>Tealium</user><email>patrick.mcwilliams@tealium.com</email></author></authors>
|
20 |
-
<date>2014-
|
21 |
-
<time>
|
22 |
-
<contents><target name="magelocal"><dir name="Tealium"><dir name="Tags"><dir name="Helper"><file name="Data.php" hash="
|
23 |
<compatible/>
|
24 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
25 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Tealium_Tags</name>
|
4 |
+
<version>1.0.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Tealum tag management solution</summary>
|
10 |
<description>Tealum tag management solution extension injects the Tealium javascript into your magento pages, and on specific pages injects special javascript so that you can access specific data elements such as product, category or cart data.</description>
|
11 |
+
<notes>1.0.2 - Added html/text help to admin config
|
12 |
+
1.0.1 - Fixed arrays that were rendering as strings
|
13 |
+
1.0.0 - refactored based on Tealium class
|
14 |
+
* added support for external UDO definition
|
15 |
+
* added support for diagnostic pixel
|
16 |
+
0.4.4d - added output of diagnostic pixel
|
17 |
+
0.4.4 - strip commas from all dollar values
|
18 |
0.4.3 - fix for bad array on order page
|
19 |
0.4.2 - added simple discount array
|
20 |
0.4.0 - fix for individual discounts and number formats
|
23 |
0.2.0 - fix for product page tag syntax
|
24 |
0.1.0 - initial release</notes>
|
25 |
<authors><author><name>Tealium</name><user>Tealium</user><email>patrick.mcwilliams@tealium.com</email></author></authors>
|
26 |
+
<date>2014-04-23</date>
|
27 |
+
<time>17:45:36</time>
|
28 |
+
<contents><target name="magelocal"><dir name="Tealium"><dir name="Tags"><dir name="Helper"><file name="Data.php" hash="bfeaea2594252a11497511272c6f53b4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="e6ec5ba973cdb97a9925f02575392865"/><file name="config.xml" hash="c736b55d5e3cc05cbf7bc27fe7a851e5"/><file name="system.xml" hash="bdf256ea75eb731ddb19d77e748f59d1"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Tealium_Tags.xml" hash="3d6843433dffefb4600573950a83e765"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="tealium_tags.xml" hash="f1a764ba60627bbf4b0113c454bb892a"/></dir><dir name="template"><dir name="tealium_tags"><file name="base.phtml" hash="d645769fa5a71195baba96bdd68ad979"/><file name="catalog_product_compare_index.phtml" hash="810cb1cf8b17ab77d5addf75097dcc12"/><file name="catalogsearch_advanced_result_index.phtml" hash="df8e2d21436261f855dcb4bb1d6497fb"/><file name="catalogsearch_result_index.phtml" hash="063b17148b5d031e4a445d59d85a02c1"/><file name="catalogsearch_term_popular.phtml" hash="2e591a75a8f7b226d0dbf459a3fb556b"/><file name="category.phtml" hash="6b3bfa75f142d2ac45b2a7a68fe09024"/><file name="checkout_cart_index.phtml" hash="20d90e76ded92964e1e406353a1ae777"/><file name="checkout_onepage.phtml" hash="234c6528de89e33f3d745e147fc2919b"/><file name="checkout_success.phtml" hash="82eedb745c4a17c7864089f746104575"/><file name="cms.phtml" hash="b27d54573e11d3ed64f9fc4e3b842d32"/><file name="customer.phtml" hash="edbac3f55223f19edd5f78f66ceb4a16"/><file name="generic.phtml" hash="0719e2af0f4afb96638a31489c67152a"/><file name="guest_sales.phtml" hash="e8c438cddca07aa8e44549c6c63f6b08"/><file name="product.phtml" hash="c5568efedd7cd11803a9558566e8d1f1"/><file name="product_send.phtml" hash="b55cc99a06028171333aad3f16f8e7b3"/><file name="seo.phtml" hash="8a5c742b13e79c8019e4619d7aba1eba"/><file name="tag_list_index.phtml" hash="6fa3c2c58ac6138fe406fbc71b116823"/><file name="tag_product_list.phtml" hash="e6bf4fc7d91f5378d3d53dcd455f73f9"/><file name=".checkout_success.phtml.swp" hash="9b57a7ce9a428a02d446520e721f9d27"/></dir></dir></dir></dir></dir></target><target name="magelib"><dir name="Tealium"><file name="Tealium.php" hash="74e6bde11cbcb6ccb0d8ade118f2e3d1"/><file name="TealiumAPI.php" hash="fc6436687206e42f528f9ba4a3527f93"/><file name="TealiumInit.php" hash="d13a565c6a078e38be49d989de58e2b8"/></dir></target></contents>
|
29 |
<compatible/>
|
30 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
31 |
</package>
|