Version Notes
- Small improvements.
Download this release
Release Info
Developer | Roeland van Oostenbrugge |
Extension | Converdo_Analytics |
Version | 1.2.4.5 |
Comparing to | |
See all releases |
Code changes from version 1.2.3.5 to 1.2.4.5
- app/code/community/Converdo/Analytics/Block/Tracker.php +16 -0
- app/code/community/Converdo/Analytics/Helper/Data.php +11 -11
- app/code/community/Converdo/Analytics/Model/Observer.php +0 -2
- app/code/community/Converdo/Analytics/etc/adminhtml.xml +0 -45
- app/code/community/Converdo/Analytics/etc/config.xml +10 -3
- app/code/community/Converdo/Analytics/etc/system.xml +8 -6
- app/design/frontend/base/default/template/analytics/analytics.phtml +4 -1
- app/locale/en_US/Converdo_Magento.csv +0 -5
- lib/Converdo/Entity/Product.php +1 -1
- lib/Converdo/Support/QueryParser.php +86 -0
- lib/Converdo/Support/QueryType.php +49 -0
- lib/Converdo/Support/Writer.php +0 -123
- lib/Converdo/Tracker/Processor/AbstractProcessor.php +23 -38
- lib/Converdo/Tracker/Processor/CartProcessor.php +12 -19
- lib/Converdo/Tracker/Processor/CategoryViewProcessor.php +8 -21
- lib/Converdo/Tracker/Processor/CheckoutProcessor.php +17 -23
- lib/Converdo/Tracker/Processor/CustomVariableProcessor.php +5 -12
- lib/Converdo/Tracker/Processor/FootProcessor.php +4 -13
- lib/Converdo/Tracker/Processor/HeadProcessor.php +3 -12
- lib/Converdo/Tracker/Processor/Interface/ProcessorInterface.php +4 -3
- lib/Converdo/Tracker/Processor/PageViewProcessor.php +0 -8
- lib/Converdo/Tracker/Processor/ProductViewProcessor.php +21 -15
- lib/Converdo/Tracker/Query/AbstractQuery.php +10 -11
- lib/Converdo/Tracker/Query/CategoryView.php +8 -14
- lib/Converdo/Tracker/Query/CustomVariable.php +7 -9
- lib/Converdo/Tracker/Query/EcommerceCartUpdate.php +12 -4
- lib/Converdo/Tracker/Query/EcommerceItem.php +8 -14
- lib/Converdo/Tracker/Query/EcommerceTracking.php +5 -1
- lib/Converdo/Tracker/Query/EcommerceView.php +0 -24
- lib/Converdo/Tracker/Query/HeartBeat.php +5 -1
- lib/Converdo/Tracker/Query/Interface/QueryInterface.php +8 -8
- lib/Converdo/Tracker/Query/LinkTracking.php +5 -1
- lib/Converdo/Tracker/Query/PageTracking.php +3 -4
- lib/Converdo/Tracker/Query/PageView.php +7 -9
- lib/Converdo/Tracker/Query/ProductView.php +8 -14
- lib/Converdo/Tracker/Query/SiteId.php +6 -8
- lib/Converdo/Tracker/Query/TrackerUrl.php +6 -21
- package.xml +4 -4
- skin/adminhtml/default/default/converdoanalytics/css/system_config_edit.css +5 -0
- skin/adminhtml/default/default/converdoanalytics/images/favicon.png +0 -0
app/code/community/Converdo/Analytics/Block/Tracker.php
CHANGED
@@ -23,6 +23,10 @@ class Converdo_Analytics_Block_Tracker extends Mage_Core_Block_Template
|
|
23 |
return null;
|
24 |
}
|
25 |
|
|
|
|
|
|
|
|
|
26 |
$processors[] = new Converdo_Tracker_Processor_HeadProcessor;
|
27 |
$processors[] = new Converdo_Tracker_Processor_CartProcessor;
|
28 |
$processors[] = new Converdo_Tracker_Processor_CheckoutProcessor;
|
@@ -48,6 +52,8 @@ class Converdo_Analytics_Block_Tracker extends Mage_Core_Block_Template
|
|
48 |
$customVariables->process();
|
49 |
}
|
50 |
}
|
|
|
|
|
51 |
}
|
52 |
|
53 |
/**
|
@@ -60,6 +66,16 @@ class Converdo_Analytics_Block_Tracker extends Mage_Core_Block_Template
|
|
60 |
$this->orderedIds = $orderedIds;
|
61 |
}
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
/**
|
64 |
* Get the ordered ids.
|
65 |
*
|
23 |
return null;
|
24 |
}
|
25 |
|
26 |
+
foreach (Mage::getModel('checkout/cart')->getQuote()->getAllVisibleItems() as $productId) {
|
27 |
+
$this->addOrderedId($productId->getProductId());
|
28 |
+
}
|
29 |
+
|
30 |
$processors[] = new Converdo_Tracker_Processor_HeadProcessor;
|
31 |
$processors[] = new Converdo_Tracker_Processor_CartProcessor;
|
32 |
$processors[] = new Converdo_Tracker_Processor_CheckoutProcessor;
|
52 |
$customVariables->process();
|
53 |
}
|
54 |
}
|
55 |
+
|
56 |
+
echo Converdo_Support_QueryParser::parse();
|
57 |
}
|
58 |
|
59 |
/**
|
66 |
$this->orderedIds = $orderedIds;
|
67 |
}
|
68 |
|
69 |
+
/**
|
70 |
+
* Add an order id.
|
71 |
+
*
|
72 |
+
* @param array $id
|
73 |
+
*/
|
74 |
+
public function addOrderedId($id)
|
75 |
+
{
|
76 |
+
$this->orderedIds[] = $id;
|
77 |
+
}
|
78 |
+
|
79 |
/**
|
80 |
* Get the ordered ids.
|
81 |
*
|
app/code/community/Converdo/Analytics/Helper/Data.php
CHANGED
@@ -8,9 +8,9 @@ class Converdo_Analytics_Helper_Data extends Mage_Core_Helper_Abstract
|
|
8 |
* @param null $store
|
9 |
* @return bool
|
10 |
*/
|
11 |
-
public function isEnabled($store = null)
|
12 |
{
|
13 |
-
return (bool)
|
14 |
&& Mage::getStoreConfigFlag('converdo/analytics/active', $store)
|
15 |
&& Mage::getStoreConfigFlag('converdo/analytics/token', $store);
|
16 |
}
|
@@ -21,7 +21,7 @@ class Converdo_Analytics_Helper_Data extends Mage_Core_Helper_Abstract
|
|
21 |
* @param null $store
|
22 |
* @return string
|
23 |
*/
|
24 |
-
public function getSiteId($store = null)
|
25 |
{
|
26 |
return Mage::getStoreConfig('converdo/analytics/site', $store);
|
27 |
}
|
@@ -32,29 +32,29 @@ class Converdo_Analytics_Helper_Data extends Mage_Core_Helper_Abstract
|
|
32 |
* @param null $store
|
33 |
* @return bool
|
34 |
*/
|
35 |
-
public function hasSiteId($store = null)
|
36 |
{
|
37 |
-
return (bool)
|
38 |
}
|
39 |
|
40 |
-
public function getSiteUrl()
|
41 |
{
|
42 |
-
return '//
|
43 |
}
|
44 |
|
45 |
-
public function getPhpTracker($full = false)
|
46 |
{
|
47 |
if ($full) {
|
48 |
-
return
|
49 |
}
|
50 |
|
51 |
return 'tracker.php';
|
52 |
}
|
53 |
|
54 |
-
public function getJsTracker($full = false)
|
55 |
{
|
56 |
if ($full) {
|
57 |
-
return
|
58 |
}
|
59 |
|
60 |
return 'tracker.js';
|
8 |
* @param null $store
|
9 |
* @return bool
|
10 |
*/
|
11 |
+
public static function isEnabled($store = null)
|
12 |
{
|
13 |
+
return (bool) self::hasSiteId($store)
|
14 |
&& Mage::getStoreConfigFlag('converdo/analytics/active', $store)
|
15 |
&& Mage::getStoreConfigFlag('converdo/analytics/token', $store);
|
16 |
}
|
21 |
* @param null $store
|
22 |
* @return string
|
23 |
*/
|
24 |
+
public static function getSiteId($store = null)
|
25 |
{
|
26 |
return Mage::getStoreConfig('converdo/analytics/site', $store);
|
27 |
}
|
32 |
* @param null $store
|
33 |
* @return bool
|
34 |
*/
|
35 |
+
public static function hasSiteId($store = null)
|
36 |
{
|
37 |
+
return (bool) self::getSiteId($store);
|
38 |
}
|
39 |
|
40 |
+
public static function getSiteUrl()
|
41 |
{
|
42 |
+
return '//tracker.converdo.com/';
|
43 |
}
|
44 |
|
45 |
+
public static function getPhpTracker($full = false)
|
46 |
{
|
47 |
if ($full) {
|
48 |
+
return self::getSiteUrl() . 'tracker.php';
|
49 |
}
|
50 |
|
51 |
return 'tracker.php';
|
52 |
}
|
53 |
|
54 |
+
public static function getJsTracker($full = false)
|
55 |
{
|
56 |
if ($full) {
|
57 |
+
return self::getSiteUrl() . 'tracker.js';
|
58 |
}
|
59 |
|
60 |
return 'tracker.js';
|
app/code/community/Converdo/Analytics/Model/Observer.php
CHANGED
@@ -35,8 +35,6 @@ class Converdo_Analytics_Model_Observer
|
|
35 |
|
36 |
$block = Mage::app()->getFrontController()->getAction()->getLayout()->getBlock('converdo_analytics');
|
37 |
|
38 |
-
Mage::log('BLOCK: ' . get_class($block));
|
39 |
-
|
40 |
if ($block) {
|
41 |
$block->setOrderedIds($orderIds);
|
42 |
}
|
35 |
|
36 |
$block = Mage::app()->getFrontController()->getAction()->getLayout()->getBlock('converdo_analytics');
|
37 |
|
|
|
|
|
38 |
if ($block) {
|
39 |
$block->setOrderedIds($orderIds);
|
40 |
}
|
app/code/community/Converdo/Analytics/etc/adminhtml.xml
CHANGED
@@ -1,23 +1,6 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
|
3 |
<config>
|
4 |
-
<menu>
|
5 |
-
<report translate="title" module="reports">
|
6 |
-
<title>Reports</title>
|
7 |
-
<sort_order>80</sort_order>
|
8 |
-
<children>
|
9 |
-
<iframe_piwik translate="title" module="reports">
|
10 |
-
<title>Piwik iFrame</title>
|
11 |
-
<sort_order>99999</sort_order>
|
12 |
-
<action>analytics/index/index</action>
|
13 |
-
<depends>
|
14 |
-
<config>converdo/analytics/active</config>
|
15 |
-
</depends>
|
16 |
-
</iframe_piwik>
|
17 |
-
</children>
|
18 |
-
</report>
|
19 |
-
</menu>
|
20 |
-
|
21 |
<acl>
|
22 |
<resources>
|
23 |
<admin>
|
@@ -36,33 +19,5 @@
|
|
36 |
</children>
|
37 |
</admin>
|
38 |
</resources>
|
39 |
-
</acl>
|
40 |
-
<acl>
|
41 |
-
<resources>
|
42 |
-
<admin>
|
43 |
-
<children>
|
44 |
-
<report translate="title" module="reports">
|
45 |
-
<title>Reports</title>
|
46 |
-
<sort_order>80</sort_order>
|
47 |
-
<children>
|
48 |
-
<iframe_piwik translate="title">
|
49 |
-
<title>Piwik Iframe</title>
|
50 |
-
</iframe_piwik>
|
51 |
-
</children>
|
52 |
-
</report>
|
53 |
-
<system>
|
54 |
-
<children>
|
55 |
-
<config>
|
56 |
-
<children>
|
57 |
-
<reports translate="title" module="reports">
|
58 |
-
<title>Reports</title>
|
59 |
-
</reports>
|
60 |
-
</children>
|
61 |
-
</config>
|
62 |
-
</children>
|
63 |
-
</system>
|
64 |
-
</children>
|
65 |
-
</admin>
|
66 |
-
</resources>
|
67 |
</acl>
|
68 |
</config>
|
1 |
<?xml version="1.0"?>
|
2 |
|
3 |
<config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
<acl>
|
5 |
<resources>
|
6 |
<admin>
|
19 |
</children>
|
20 |
</admin>
|
21 |
</resources>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
</acl>
|
23 |
</config>
|
app/code/community/Converdo/Analytics/etc/config.xml
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<config>
|
4 |
<modules>
|
5 |
<Converdo_Analytics>
|
6 |
-
<version>1.2.
|
7 |
</Converdo_Analytics>
|
8 |
</modules>
|
9 |
<global>
|
@@ -26,11 +26,11 @@
|
|
26 |
<frontend>
|
27 |
<translate>
|
28 |
<modules>
|
29 |
-
<
|
30 |
<files>
|
31 |
<default>Converdo_Analytics.csv</default>
|
32 |
</files>
|
33 |
-
</
|
34 |
</modules>
|
35 |
</translate>
|
36 |
<events>
|
@@ -78,6 +78,13 @@
|
|
78 |
</Converdo_Analytics>
|
79 |
</modules>
|
80 |
</translate>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
</adminhtml>
|
82 |
<admin>
|
83 |
<routers>
|
3 |
<config>
|
4 |
<modules>
|
5 |
<Converdo_Analytics>
|
6 |
+
<version>1.2.4.0</version>
|
7 |
</Converdo_Analytics>
|
8 |
</modules>
|
9 |
<global>
|
26 |
<frontend>
|
27 |
<translate>
|
28 |
<modules>
|
29 |
+
<PiwikMage_PiwikAnalytics>
|
30 |
<files>
|
31 |
<default>Converdo_Analytics.csv</default>
|
32 |
</files>
|
33 |
+
</PiwikMage_PiwikAnalytics>
|
34 |
</modules>
|
35 |
</translate>
|
36 |
<events>
|
78 |
</Converdo_Analytics>
|
79 |
</modules>
|
80 |
</translate>
|
81 |
+
<layout>
|
82 |
+
<updates>
|
83 |
+
<namespace_module>
|
84 |
+
<file>converdoanalytics.xml</file>
|
85 |
+
</namespace_module>
|
86 |
+
</updates>
|
87 |
+
</layout>
|
88 |
</adminhtml>
|
89 |
<admin>
|
90 |
<routers>
|
app/code/community/Converdo/Analytics/etc/system.xml
CHANGED
@@ -5,6 +5,7 @@
|
|
5 |
<converdo translate="label" module="analytics">
|
6 |
<label>Converdo Analytics</label>
|
7 |
<tab>sales</tab>
|
|
|
8 |
<frontend_type>text</frontend_type>
|
9 |
<sort_order>350</sort_order>
|
10 |
<show_in_default>1</show_in_default>
|
@@ -21,6 +22,7 @@
|
|
21 |
<fields>
|
22 |
<active translate="label">
|
23 |
<label>Enable</label>
|
|
|
24 |
<frontend_type>select</frontend_type>
|
25 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
26 |
<sort_order>10</sort_order>
|
@@ -30,8 +32,8 @@
|
|
30 |
</active>
|
31 |
|
32 |
<site translate="label">
|
33 |
-
<label>Website
|
34 |
-
<comment>Find
|
35 |
<frontend_type>text</frontend_type>
|
36 |
<sort_order>30</sort_order>
|
37 |
<show_in_default>1</show_in_default>
|
@@ -40,8 +42,8 @@
|
|
40 |
</site>
|
41 |
|
42 |
<token translate="label">
|
43 |
-
<label>Account
|
44 |
-
<comment>Find
|
45 |
<frontend_type>text</frontend_type>
|
46 |
<sort_order>40</sort_order>
|
47 |
<show_in_default>1</show_in_default>
|
@@ -50,8 +52,8 @@
|
|
50 |
</token>
|
51 |
|
52 |
<encryption translate="label">
|
53 |
-
<label>
|
54 |
-
<comment>
|
55 |
<frontend_type>text</frontend_type>
|
56 |
<sort_order>40</sort_order>
|
57 |
<show_in_default>1</show_in_default>
|
5 |
<converdo translate="label" module="analytics">
|
6 |
<label>Converdo Analytics</label>
|
7 |
<tab>sales</tab>
|
8 |
+
<class>converdo-analytics-tab</class>
|
9 |
<frontend_type>text</frontend_type>
|
10 |
<sort_order>350</sort_order>
|
11 |
<show_in_default>1</show_in_default>
|
22 |
<fields>
|
23 |
<active translate="label">
|
24 |
<label>Enable</label>
|
25 |
+
<comment>Only when enabled visitor data is tracked</comment>
|
26 |
<frontend_type>select</frontend_type>
|
27 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
28 |
<sort_order>10</sort_order>
|
32 |
</active>
|
33 |
|
34 |
<site translate="label">
|
35 |
+
<label>Website Token</label>
|
36 |
+
<comment>Find the website token in the dashboard</comment>
|
37 |
<frontend_type>text</frontend_type>
|
38 |
<sort_order>30</sort_order>
|
39 |
<show_in_default>1</show_in_default>
|
42 |
</site>
|
43 |
|
44 |
<token translate="label">
|
45 |
+
<label>Account Token</label>
|
46 |
+
<comment>Find the account token in the dashboard</comment>
|
47 |
<frontend_type>text</frontend_type>
|
48 |
<sort_order>40</sort_order>
|
49 |
<show_in_default>1</show_in_default>
|
52 |
</token>
|
53 |
|
54 |
<encryption translate="label">
|
55 |
+
<label>Encryption Token</label>
|
56 |
+
<comment>Find the encryption token in the dashboard</comment>
|
57 |
<frontend_type>text</frontend_type>
|
58 |
<sort_order>40</sort_order>
|
59 |
<show_in_default>1</show_in_default>
|
app/design/frontend/base/default/template/analytics/analytics.phtml
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
-
|
|
|
|
|
2 |
<script type="text/javascript">
|
3 |
var _paq = _paq || [];
|
4 |
(function(){
|
@@ -11,3 +13,4 @@
|
|
11 |
<noscript><p><img src="<?= Mage::helper('analytics')->getPhpTracker(true) ?>?idsite=<?= Mage::helper('analytics')->getSiteId() ?>" style="border:0" alt="" /></p></noscript>
|
12 |
<!-- END CONVERDO TRACKING CODE -->
|
13 |
|
|
1 |
+
<?php if (Mage::helper('analytics')->isEnabled()) { ?>
|
2 |
+
|
3 |
+
<!-- START CONVERDO TRACKING CODE -->
|
4 |
<script type="text/javascript">
|
5 |
var _paq = _paq || [];
|
6 |
(function(){
|
13 |
<noscript><p><img src="<?= Mage::helper('analytics')->getPhpTracker(true) ?>?idsite=<?= Mage::helper('analytics')->getSiteId() ?>" style="border:0" alt="" /></p></noscript>
|
14 |
<!-- END CONVERDO TRACKING CODE -->
|
15 |
|
16 |
+
<?php } ?>
|
app/locale/en_US/Converdo_Magento.csv
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
"Site Id","Site Id"
|
2 |
-
"Install Path","Install Path"
|
3 |
-
"Enable","Enable"
|
4 |
-
"Piwik Analytics Control","Piwik Analytics Control"
|
5 |
-
"Piwik Analytics","Piwik Analytics"
|
|
|
|
|
|
|
|
|
|
lib/Converdo/Entity/Product.php
CHANGED
@@ -8,7 +8,7 @@ class Converdo_Entity_Product extends Converdo_Entity_AbstractEntity implements
|
|
8 |
/**
|
9 |
* @var Mage_Catalog_Model_Product
|
10 |
*/
|
11 |
-
|
12 |
|
13 |
/**
|
14 |
* Converdo_Entity_Product constructor.
|
8 |
/**
|
9 |
* @var Mage_Catalog_Model_Product
|
10 |
*/
|
11 |
+
public $entity;
|
12 |
|
13 |
/**
|
14 |
* Converdo_Entity_Product constructor.
|
lib/Converdo/Support/QueryParser.php
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Converdo_Support_QueryParser
|
4 |
+
{
|
5 |
+
protected static $queries = [];
|
6 |
+
|
7 |
+
protected static $entity;
|
8 |
+
|
9 |
+
public static function entity($entity)
|
10 |
+
{
|
11 |
+
self::$entity = $entity;
|
12 |
+
}
|
13 |
+
|
14 |
+
public static function add(Converdo_Tracker_Query_Interface_QueryInterface $query, array $options = [])
|
15 |
+
{
|
16 |
+
$parameters = $query->with([self::$entity])->parameters();
|
17 |
+
|
18 |
+
$parameters = $parameters + $options;
|
19 |
+
|
20 |
+
ksort($parameters);
|
21 |
+
|
22 |
+
$output = self::toString($query, $parameters);
|
23 |
+
|
24 |
+
self::$queries[] = $output;
|
25 |
+
}
|
26 |
+
|
27 |
+
public static function parse()
|
28 |
+
{
|
29 |
+
return implode("\n\t\t\t\t", self::$queries);
|
30 |
+
}
|
31 |
+
|
32 |
+
|
33 |
+
|
34 |
+
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
|
43 |
+
|
44 |
+
protected static function toString(Converdo_Tracker_Query_Interface_QueryInterface $query, array $parameters = [])
|
45 |
+
{
|
46 |
+
$output = new Converdo_Support_StringBuilder();
|
47 |
+
|
48 |
+
$output->append("_paq.push(['{$query->view()}'");
|
49 |
+
|
50 |
+
foreach ($parameters as $key => $value) {
|
51 |
+
$value = self::resolve($value);
|
52 |
+
$output->append(", {$value}");
|
53 |
+
}
|
54 |
+
|
55 |
+
$output->append("]);");
|
56 |
+
|
57 |
+
return $output->toString();
|
58 |
+
}
|
59 |
+
|
60 |
+
protected static function resolve($value)
|
61 |
+
{
|
62 |
+
if (count($value) === 1 && $value[0] === Converdo_Support_QueryType::null()) {
|
63 |
+
return (string) "false";
|
64 |
+
}
|
65 |
+
|
66 |
+
if (count($value) === 1) {
|
67 |
+
return (string) "'" . $value[0] . "'";
|
68 |
+
}
|
69 |
+
|
70 |
+
switch ($value[0]) {
|
71 |
+
case Converdo_Support_QueryType::float():
|
72 |
+
return (float) $value[1];
|
73 |
+
|
74 |
+
case Converdo_Support_QueryType::integer():
|
75 |
+
return (int) $value[1];
|
76 |
+
|
77 |
+
case Converdo_Support_QueryType::null():
|
78 |
+
return (string) "false";
|
79 |
+
|
80 |
+
case Converdo_Support_QueryType::string():
|
81 |
+
return (string) "'" . $value[1] . "'";
|
82 |
+
}
|
83 |
+
|
84 |
+
return (string) "'" . $value[1] . "'";
|
85 |
+
}
|
86 |
+
}
|
lib/Converdo/Support/QueryType.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Converdo_Support_QueryType
|
4 |
+
{
|
5 |
+
protected static $integer = 2;
|
6 |
+
protected static $string = 1;
|
7 |
+
protected static $float = 3;
|
8 |
+
protected static $null = 4;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Forces the query parameter to parse as a string.
|
12 |
+
*
|
13 |
+
* @return int
|
14 |
+
*/
|
15 |
+
public static function string()
|
16 |
+
{
|
17 |
+
return self::$string;
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Forces the query parameter to parse as an integer.
|
22 |
+
*
|
23 |
+
* @return int
|
24 |
+
*/
|
25 |
+
public static function integer()
|
26 |
+
{
|
27 |
+
return self::$integer;
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Forces the query parameter to parse as a float.
|
32 |
+
*
|
33 |
+
* @return int
|
34 |
+
*/
|
35 |
+
public static function float()
|
36 |
+
{
|
37 |
+
return self::$float;
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Forces the query parameter to parse as null.
|
42 |
+
*
|
43 |
+
* @return int
|
44 |
+
*/
|
45 |
+
public static function null()
|
46 |
+
{
|
47 |
+
return self::$null;
|
48 |
+
}
|
49 |
+
}
|
lib/Converdo/Support/Writer.php
DELETED
@@ -1,123 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Converdo_Support_Writer
|
4 |
-
{
|
5 |
-
/**
|
6 |
-
* @var string
|
7 |
-
*/
|
8 |
-
public $view;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* @var array
|
12 |
-
*/
|
13 |
-
public $data = [];
|
14 |
-
|
15 |
-
/**
|
16 |
-
* @var null|Converdo_Tracker_Query_Interface_QueryInterface
|
17 |
-
*/
|
18 |
-
public $query;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* @var null|Varien_Object
|
22 |
-
*/
|
23 |
-
public $entity;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* @param $input
|
27 |
-
* @return $this
|
28 |
-
*/
|
29 |
-
public function make($input)
|
30 |
-
{
|
31 |
-
unset($this->query, $this->entity, $this->view);
|
32 |
-
|
33 |
-
if ($input instanceof Converdo_Tracker_Query_Interface_QueryInterface) {
|
34 |
-
$this->view($input->getView());
|
35 |
-
$this->with($input->getData());
|
36 |
-
$this->query = $input;
|
37 |
-
} else {
|
38 |
-
$this->view($input);
|
39 |
-
}
|
40 |
-
|
41 |
-
return $this;
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Write a new line.
|
46 |
-
*
|
47 |
-
* @param $name
|
48 |
-
* @return $this
|
49 |
-
*/
|
50 |
-
public function view($name)
|
51 |
-
{
|
52 |
-
$this->view = (string) $name;
|
53 |
-
return $this;
|
54 |
-
}
|
55 |
-
|
56 |
-
/**
|
57 |
-
* Write a new line with this data.
|
58 |
-
*
|
59 |
-
* @param mixed $data
|
60 |
-
* @return $this
|
61 |
-
*/
|
62 |
-
public function with($data)
|
63 |
-
{
|
64 |
-
if ($data instanceof Varien_Object || $data instanceof Converdo_Entity_Interface_EntityInterface) {
|
65 |
-
$this->withEntity($data);
|
66 |
-
} elseif (is_array($data)) {
|
67 |
-
$this->withData($data);
|
68 |
-
}
|
69 |
-
|
70 |
-
return $this;
|
71 |
-
}
|
72 |
-
|
73 |
-
/**
|
74 |
-
* Add data to the query straight from the code.
|
75 |
-
*
|
76 |
-
* @param array $data
|
77 |
-
* @return $this
|
78 |
-
*/
|
79 |
-
protected function withData(array $data = [])
|
80 |
-
{
|
81 |
-
if (isset($this->query) && !empty($this->query)) {
|
82 |
-
$this->data = @((array) $this->query->getData() + $data);
|
83 |
-
} else {
|
84 |
-
$this->data = (array) $data;
|
85 |
-
}
|
86 |
-
|
87 |
-
ksort($this->data);
|
88 |
-
$this->data = array_values($this->data);
|
89 |
-
}
|
90 |
-
|
91 |
-
/**
|
92 |
-
* Add data to the query from an entity.
|
93 |
-
*
|
94 |
-
* @param $entity
|
95 |
-
* @return array
|
96 |
-
*/
|
97 |
-
protected function withEntity($entity)
|
98 |
-
{
|
99 |
-
$this->query->setEntity($entity);
|
100 |
-
$this->data = (array) $this->query->getData();
|
101 |
-
}
|
102 |
-
|
103 |
-
public function write()
|
104 |
-
{
|
105 |
-
$output = new Converdo_Support_StringBuilder;
|
106 |
-
|
107 |
-
$output->append("_paq.push(['{$this->view}'");
|
108 |
-
|
109 |
-
foreach ($this->data as $key => $value) {
|
110 |
-
if (is_numeric($value) && $value > 0 && $value == round($value, 0)) {
|
111 |
-
$output->append(", {$value}");
|
112 |
-
} elseif ($value === false) {
|
113 |
-
$output->append(', false');
|
114 |
-
} else {
|
115 |
-
$output->append(", '{$value}'");
|
116 |
-
}
|
117 |
-
}
|
118 |
-
|
119 |
-
$output->append("]);")->append("\n\t\t\t\t");
|
120 |
-
|
121 |
-
echo $output->toString();
|
122 |
-
}
|
123 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Converdo/Tracker/Processor/AbstractProcessor.php
CHANGED
@@ -2,57 +2,47 @@
|
|
2 |
|
3 |
abstract class Converdo_Tracker_Processor_AbstractProcessor
|
4 |
{
|
5 |
-
/**
|
6 |
-
* @var Converdo_Support_Writer
|
7 |
-
*/
|
8 |
-
protected $writer;
|
9 |
-
|
10 |
/**
|
11 |
* @var array
|
12 |
*/
|
13 |
protected $configuration = [];
|
14 |
|
15 |
/**
|
16 |
-
*
|
17 |
-
*/
|
18 |
-
public function __construct()
|
19 |
-
{
|
20 |
-
$this->writer = new Converdo_Support_Writer;
|
21 |
-
}
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Get whether the processor is responsible for the job.
|
25 |
*
|
26 |
-
* @
|
27 |
-
* @return bool
|
28 |
*/
|
29 |
-
|
30 |
{
|
31 |
-
return
|
32 |
}
|
33 |
|
34 |
/**
|
35 |
-
*
|
36 |
*
|
37 |
-
* @
|
38 |
*/
|
39 |
-
|
40 |
{
|
41 |
-
|
42 |
}
|
43 |
|
44 |
/**
|
45 |
-
*
|
46 |
*
|
47 |
-
* @
|
48 |
*/
|
49 |
-
public function
|
50 |
{
|
51 |
-
$this->
|
|
|
|
|
|
|
|
|
52 |
}
|
53 |
|
54 |
/**
|
55 |
-
*
|
56 |
*
|
57 |
* @return bool
|
58 |
*/
|
@@ -62,22 +52,17 @@ abstract class Converdo_Tracker_Processor_AbstractProcessor
|
|
62 |
}
|
63 |
|
64 |
/**
|
65 |
-
*
|
66 |
-
*
|
67 |
-
* @return
|
68 |
*/
|
69 |
-
public function
|
70 |
{
|
71 |
-
|
72 |
-
return null;
|
73 |
-
}
|
74 |
-
|
75 |
-
return (array) $this->configuration;
|
76 |
}
|
77 |
|
78 |
/**
|
79 |
-
*
|
80 |
-
*
|
81 |
* @return void
|
82 |
*/
|
83 |
abstract public function process();
|
2 |
|
3 |
abstract class Converdo_Tracker_Processor_AbstractProcessor
|
4 |
{
|
|
|
|
|
|
|
|
|
|
|
5 |
/**
|
6 |
* @var array
|
7 |
*/
|
8 |
protected $configuration = [];
|
9 |
|
10 |
/**
|
11 |
+
* Returns an encrypted JSON string with configuration.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*
|
13 |
+
* @return array
|
|
|
14 |
*/
|
15 |
+
protected function configuration()
|
16 |
{
|
17 |
+
return [];
|
18 |
}
|
19 |
|
20 |
/**
|
21 |
+
* Sets the configuration.
|
22 |
*
|
23 |
+
* @param array|string $configuration
|
24 |
*/
|
25 |
+
public function setConfiguration($configuration)
|
26 |
{
|
27 |
+
$this->configuration = (array) $configuration;
|
28 |
}
|
29 |
|
30 |
/**
|
31 |
+
* Gets the configuration.
|
32 |
*
|
33 |
+
* @return null|string
|
34 |
*/
|
35 |
+
public function getConfiguration()
|
36 |
{
|
37 |
+
if (! $this->hasConfiguration()) {
|
38 |
+
return null;
|
39 |
+
}
|
40 |
+
|
41 |
+
return (array) $this->configuration;
|
42 |
}
|
43 |
|
44 |
/**
|
45 |
+
* Gets whether the configuration is set and has data.
|
46 |
*
|
47 |
* @return bool
|
48 |
*/
|
52 |
}
|
53 |
|
54 |
/**
|
55 |
+
* @inheritdoc
|
56 |
+
* @param Converdo_Analytics_Block_Tracker $block
|
57 |
+
* @return bool
|
58 |
*/
|
59 |
+
public function responsible(Converdo_Analytics_Block_Tracker $block)
|
60 |
{
|
61 |
+
return true;
|
|
|
|
|
|
|
|
|
62 |
}
|
63 |
|
64 |
/**
|
65 |
+
* @inheritdoc
|
|
|
66 |
* @return void
|
67 |
*/
|
68 |
abstract public function process();
|
lib/Converdo/Tracker/Processor/CartProcessor.php
CHANGED
@@ -8,17 +8,8 @@ class Converdo_Tracker_Processor_CartProcessor extends Converdo_Tracker_Processo
|
|
8 |
protected $cart;
|
9 |
|
10 |
/**
|
11 |
-
*
|
12 |
-
|
13 |
-
public function __construct()
|
14 |
-
{
|
15 |
-
parent::__construct();
|
16 |
-
}
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Get whether the processor is responsible for the job.
|
20 |
-
*
|
21 |
-
* @param Converdo_Analytics_Block_Tracker $block
|
22 |
* @return bool
|
23 |
*/
|
24 |
public function responsible(Converdo_Analytics_Block_Tracker $block)
|
@@ -36,21 +27,23 @@ class Converdo_Tracker_Processor_CartProcessor extends Converdo_Tracker_Processo
|
|
36 |
public function process()
|
37 |
{
|
38 |
foreach ($this->cart->getQuote()->getAllVisibleItems() as $key => $item) {
|
39 |
-
$product
|
40 |
-
$product
|
41 |
-
$category
|
42 |
|
43 |
if (($categoryIds = $product->getCategoryIds()) && count($categoryIds)) {
|
44 |
$category = Mage::getModel('catalog/category')->load($categoryIds[0]);
|
45 |
$category = $category->getName();
|
46 |
}
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
52 |
}
|
53 |
|
54 |
-
|
|
|
55 |
}
|
56 |
}
|
8 |
protected $cart;
|
9 |
|
10 |
/**
|
11 |
+
* @inheritdoc
|
12 |
+
* @param Converdo_Analytics_Block_Tracker $block
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
* @return bool
|
14 |
*/
|
15 |
public function responsible(Converdo_Analytics_Block_Tracker $block)
|
27 |
public function process()
|
28 |
{
|
29 |
foreach ($this->cart->getQuote()->getAllVisibleItems() as $key => $item) {
|
30 |
+
$product = Mage::getModel('catalog/product')->load($item->product_id);
|
31 |
+
$product = new Converdo_Entity_Product($product);
|
32 |
+
$category = null;
|
33 |
|
34 |
if (($categoryIds = $product->getCategoryIds()) && count($categoryIds)) {
|
35 |
$category = Mage::getModel('catalog/category')->load($categoryIds[0]);
|
36 |
$category = $category->getName();
|
37 |
}
|
38 |
|
39 |
+
Converdo_Support_QueryParser::entity($product);
|
40 |
+
Converdo_Support_QueryParser::add(new Converdo_Tracker_Query_EcommerceItem, [
|
41 |
+
2 => [Converdo_Support_QueryType::string(), $category],
|
42 |
+
4 => [Converdo_Support_QueryType::float(), $item->getQty()],
|
43 |
+
]);
|
44 |
}
|
45 |
|
46 |
+
Converdo_Support_QueryParser::entity($this->cart);
|
47 |
+
Converdo_Support_QueryParser::add(new Converdo_Tracker_Query_EcommerceCartUpdate);
|
48 |
}
|
49 |
}
|
lib/Converdo/Tracker/Processor/CategoryViewProcessor.php
CHANGED
@@ -3,37 +3,24 @@
|
|
3 |
class Converdo_Tracker_Processor_CategoryViewProcessor extends Converdo_Tracker_Processor_AbstractProcessor
|
4 |
{
|
5 |
/**
|
6 |
-
* @
|
7 |
-
|
8 |
-
protected $category;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Converdo_Tracker_Processor_ProductViewProcessor constructor.
|
12 |
-
*/
|
13 |
-
public function __construct()
|
14 |
-
{
|
15 |
-
parent::__construct();
|
16 |
-
}
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Get whether the processor is responsible for the job.
|
20 |
-
*
|
21 |
-
* @param Mage_Core_Block_Template $block
|
22 |
* @return bool
|
23 |
*/
|
24 |
public function responsible(Mage_Core_Block_Template $block)
|
25 |
{
|
26 |
-
|
27 |
-
return Mage::app()->getFrontController()->getAction()->getFullActionName() == 'catalog_category_view';
|
28 |
}
|
29 |
|
30 |
/**
|
31 |
-
*
|
32 |
-
*
|
33 |
* @return void
|
34 |
*/
|
35 |
public function process()
|
36 |
{
|
37 |
-
$
|
|
|
|
|
|
|
38 |
}
|
39 |
}
|
3 |
class Converdo_Tracker_Processor_CategoryViewProcessor extends Converdo_Tracker_Processor_AbstractProcessor
|
4 |
{
|
5 |
/**
|
6 |
+
* @inheritdoc
|
7 |
+
* @param Mage_Core_Block_Template $block
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
* @return bool
|
9 |
*/
|
10 |
public function responsible(Mage_Core_Block_Template $block)
|
11 |
{
|
12 |
+
return Mage::registry('current_category');
|
|
|
13 |
}
|
14 |
|
15 |
/**
|
16 |
+
* @inheritdoc
|
|
|
17 |
* @return void
|
18 |
*/
|
19 |
public function process()
|
20 |
{
|
21 |
+
$category = Mage::registry('current_category');
|
22 |
+
|
23 |
+
Converdo_Support_QueryParser::entity($category);
|
24 |
+
Converdo_Support_QueryParser::add(new Converdo_Tracker_Query_CategoryView);
|
25 |
}
|
26 |
}
|
lib/Converdo/Tracker/Processor/CheckoutProcessor.php
CHANGED
@@ -13,28 +13,19 @@ class Converdo_Tracker_Processor_CheckoutProcessor extends Converdo_Tracker_Proc
|
|
13 |
protected $trackers;
|
14 |
|
15 |
/**
|
16 |
-
*
|
17 |
-
|
18 |
-
public function __construct()
|
19 |
-
{
|
20 |
-
parent::__construct();
|
21 |
-
}
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Get whether the processor is responsible for the job.
|
25 |
-
*
|
26 |
-
* @param Converdo_Analytics_Block_Tracker $block
|
27 |
* @return bool
|
28 |
*/
|
29 |
public function responsible(Converdo_Analytics_Block_Tracker $block)
|
30 |
{
|
31 |
$this->trackers = $block;
|
32 |
-
|
|
|
33 |
}
|
34 |
|
35 |
/**
|
36 |
-
*
|
37 |
-
*
|
38 |
* @return void
|
39 |
*/
|
40 |
public function process()
|
@@ -46,23 +37,26 @@ class Converdo_Tracker_Processor_CheckoutProcessor extends Converdo_Tracker_Proc
|
|
46 |
foreach ($order->getAllVisibleItems() as $key => $product) {
|
47 |
$product = Mage::getModel('catalog/product')->load($product->product_id);
|
48 |
$product = new Converdo_Entity_Product($product);
|
49 |
-
$category =
|
50 |
|
51 |
if (($categoryIds = $product->getCategoryIds()) && count($categoryIds)) {
|
52 |
$category = Mage::getModel('catalog/category')->load($categoryIds[0]);
|
53 |
$category = $category->getName();
|
54 |
}
|
55 |
|
56 |
-
|
|
|
|
|
|
|
57 |
}
|
58 |
|
59 |
-
|
60 |
-
0
|
61 |
-
1
|
62 |
-
2
|
63 |
-
3
|
64 |
-
4
|
65 |
-
])
|
66 |
}
|
67 |
}
|
68 |
}
|
13 |
protected $trackers;
|
14 |
|
15 |
/**
|
16 |
+
* @inheritdoc
|
17 |
+
* @param Converdo_Analytics_Block_Tracker $block
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
* @return bool
|
19 |
*/
|
20 |
public function responsible(Converdo_Analytics_Block_Tracker $block)
|
21 |
{
|
22 |
$this->trackers = $block;
|
23 |
+
|
24 |
+
return $block->hasOrderedIds();
|
25 |
}
|
26 |
|
27 |
/**
|
28 |
+
* @inheritdoc
|
|
|
29 |
* @return void
|
30 |
*/
|
31 |
public function process()
|
37 |
foreach ($order->getAllVisibleItems() as $key => $product) {
|
38 |
$product = Mage::getModel('catalog/product')->load($product->product_id);
|
39 |
$product = new Converdo_Entity_Product($product);
|
40 |
+
$category = "";
|
41 |
|
42 |
if (($categoryIds = $product->getCategoryIds()) && count($categoryIds)) {
|
43 |
$category = Mage::getModel('catalog/category')->load($categoryIds[0]);
|
44 |
$category = $category->getName();
|
45 |
}
|
46 |
|
47 |
+
Converdo_Support_QueryParser::entity($product);
|
48 |
+
Converdo_Support_QueryParser::add(new Converdo_Tracker_Query_EcommerceItem, [
|
49 |
+
2 => [Converdo_Support_QueryType::string(), $category],
|
50 |
+
]);
|
51 |
}
|
52 |
|
53 |
+
Converdo_Support_QueryParser::add(new Converdo_Tracker_Query_EcommerceTracking, [
|
54 |
+
0 => [Converdo_Support_QueryType::integer(), $order->getIncrementId()],
|
55 |
+
1 => [Converdo_Support_QueryType::float(), $order->getBaseGrandTotal()],
|
56 |
+
2 => [Converdo_Support_QueryType::float(), number_format($order->getGrandTotal() - $order->getShippingAmount() - $order->getShippingTaxAmount(), 2)],
|
57 |
+
3 => [Converdo_Support_QueryType::float(), $order->getBaseTaxAmount()],
|
58 |
+
4 => [Converdo_Support_QueryType::float(), $order->getBaseShippingAmount()],
|
59 |
+
]);
|
60 |
}
|
61 |
}
|
62 |
}
|
lib/Converdo/Tracker/Processor/CustomVariableProcessor.php
CHANGED
@@ -7,14 +7,6 @@ class Converdo_Tracker_Processor_CustomVariableProcessor extends Converdo_Tracke
|
|
7 |
*/
|
8 |
protected $product;
|
9 |
|
10 |
-
/**
|
11 |
-
* Converdo_Tracker_Processor_ProductViewProcessor constructor.
|
12 |
-
*/
|
13 |
-
public function __construct()
|
14 |
-
{
|
15 |
-
parent::__construct();
|
16 |
-
}
|
17 |
-
|
18 |
/**
|
19 |
* Get whether the processor is responsible for the job.
|
20 |
*
|
@@ -24,6 +16,7 @@ class Converdo_Tracker_Processor_CustomVariableProcessor extends Converdo_Tracke
|
|
24 |
public function responsible(Converdo_Analytics_Block_Tracker $block)
|
25 |
{
|
26 |
$this->configuration = $block->configuration;
|
|
|
27 |
return true;
|
28 |
}
|
29 |
|
@@ -34,9 +27,9 @@ class Converdo_Tracker_Processor_CustomVariableProcessor extends Converdo_Tracke
|
|
34 |
*/
|
35 |
public function process()
|
36 |
{
|
37 |
-
|
38 |
-
2
|
39 |
-
3
|
40 |
-
])
|
41 |
}
|
42 |
}
|
7 |
*/
|
8 |
protected $product;
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
/**
|
11 |
* Get whether the processor is responsible for the job.
|
12 |
*
|
16 |
public function responsible(Converdo_Analytics_Block_Tracker $block)
|
17 |
{
|
18 |
$this->configuration = $block->configuration;
|
19 |
+
|
20 |
return true;
|
21 |
}
|
22 |
|
27 |
*/
|
28 |
public function process()
|
29 |
{
|
30 |
+
Converdo_Support_QueryParser::add(new Converdo_Tracker_Query_CustomVariable, [
|
31 |
+
2 => [Converdo_Support_QueryType::string(), Converdo_Support_Crypt::encrypt(json_encode($this->configuration, true))],
|
32 |
+
3 => [Converdo_Support_QueryType::string(), 'page'],
|
33 |
+
]);
|
34 |
}
|
35 |
}
|
lib/Converdo/Tracker/Processor/FootProcessor.php
CHANGED
@@ -3,22 +3,13 @@
|
|
3 |
class Converdo_Tracker_Processor_FootProcessor extends Converdo_Tracker_Processor_AbstractProcessor
|
4 |
{
|
5 |
/**
|
6 |
-
*
|
7 |
-
*/
|
8 |
-
public function __construct()
|
9 |
-
{
|
10 |
-
parent::__construct();
|
11 |
-
}
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Process everything.
|
15 |
-
*
|
16 |
* @return void
|
17 |
*/
|
18 |
public function process()
|
19 |
{
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
}
|
24 |
}
|
3 |
class Converdo_Tracker_Processor_FootProcessor extends Converdo_Tracker_Processor_AbstractProcessor
|
4 |
{
|
5 |
/**
|
6 |
+
* @inheritdoc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
* @return void
|
8 |
*/
|
9 |
public function process()
|
10 |
{
|
11 |
+
Converdo_Support_QueryParser::add(new Converdo_Tracker_Query_PageTracking);
|
12 |
+
Converdo_Support_QueryParser::add(new Converdo_Tracker_Query_LinkTracking);
|
13 |
+
Converdo_Support_QueryParser::add(new Converdo_Tracker_Query_HeartBeat);
|
14 |
}
|
15 |
}
|
lib/Converdo/Tracker/Processor/HeadProcessor.php
CHANGED
@@ -3,21 +3,12 @@
|
|
3 |
class Converdo_Tracker_Processor_HeadProcessor extends Converdo_Tracker_Processor_AbstractProcessor
|
4 |
{
|
5 |
/**
|
6 |
-
*
|
7 |
-
*/
|
8 |
-
public function __construct()
|
9 |
-
{
|
10 |
-
parent::__construct();
|
11 |
-
}
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Process everything.
|
15 |
-
*
|
16 |
* @return void
|
17 |
*/
|
18 |
public function process()
|
19 |
{
|
20 |
-
|
21 |
-
|
22 |
}
|
23 |
}
|
3 |
class Converdo_Tracker_Processor_HeadProcessor extends Converdo_Tracker_Processor_AbstractProcessor
|
4 |
{
|
5 |
/**
|
6 |
+
* @inheritdoc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
* @return void
|
8 |
*/
|
9 |
public function process()
|
10 |
{
|
11 |
+
Converdo_Support_QueryParser::add(new Converdo_Tracker_Query_SiteId);
|
12 |
+
Converdo_Support_QueryParser::add(new Converdo_Tracker_Query_TrackerUrl);
|
13 |
}
|
14 |
}
|
lib/Converdo/Tracker/Processor/Interface/ProcessorInterface.php
CHANGED
@@ -3,14 +3,15 @@
|
|
3 |
interface Converdo_Tracker_Processor_Interface_ProcessorInterface
|
4 |
{
|
5 |
/**
|
6 |
-
*
|
7 |
*
|
|
|
8 |
* @return bool
|
9 |
*/
|
10 |
-
public function responsible();
|
11 |
|
12 |
/**
|
13 |
-
*
|
14 |
*
|
15 |
* @return void
|
16 |
*/
|
3 |
interface Converdo_Tracker_Processor_Interface_ProcessorInterface
|
4 |
{
|
5 |
/**
|
6 |
+
* Gets whether the processor is responsible for the job.
|
7 |
*
|
8 |
+
* @param Converdo_Analytics_Block_Tracker $block
|
9 |
* @return bool
|
10 |
*/
|
11 |
+
public function responsible(Converdo_Analytics_Block_Tracker $block);
|
12 |
|
13 |
/**
|
14 |
+
* Processes everything.
|
15 |
*
|
16 |
* @return void
|
17 |
*/
|
lib/Converdo/Tracker/Processor/PageViewProcessor.php
CHANGED
@@ -2,14 +2,6 @@
|
|
2 |
|
3 |
class Converdo_Tracker_Processor_PageViewProcessor extends Converdo_Tracker_Processor_AbstractProcessor
|
4 |
{
|
5 |
-
/**
|
6 |
-
* Converdo_Tracker_Processor_ProductViewProcessor constructor.
|
7 |
-
*/
|
8 |
-
public function __construct()
|
9 |
-
{
|
10 |
-
parent::__construct();
|
11 |
-
}
|
12 |
-
|
13 |
/**
|
14 |
* Process everything.
|
15 |
*
|
2 |
|
3 |
class Converdo_Tracker_Processor_PageViewProcessor extends Converdo_Tracker_Processor_AbstractProcessor
|
4 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
/**
|
6 |
* Process everything.
|
7 |
*
|
lib/Converdo/Tracker/Processor/ProductViewProcessor.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
class Converdo_Tracker_Processor_ProductViewProcessor extends Converdo_Tracker_Processor_AbstractProcessor
|
4 |
{
|
5 |
/**
|
6 |
-
* @var
|
7 |
*/
|
8 |
protected $product;
|
9 |
|
@@ -12,14 +12,6 @@ class Converdo_Tracker_Processor_ProductViewProcessor extends Converdo_Tracker_P
|
|
12 |
*/
|
13 |
protected $categories = [];
|
14 |
|
15 |
-
/**
|
16 |
-
* Converdo_Tracker_Processor_ProductViewProcessor constructor.
|
17 |
-
*/
|
18 |
-
public function __construct()
|
19 |
-
{
|
20 |
-
parent::__construct();
|
21 |
-
}
|
22 |
-
|
23 |
/**
|
24 |
* Get whether the processor is responsible for the job.
|
25 |
*
|
@@ -28,8 +20,7 @@ class Converdo_Tracker_Processor_ProductViewProcessor extends Converdo_Tracker_P
|
|
28 |
*/
|
29 |
public function responsible(Converdo_Analytics_Block_Tracker $block)
|
30 |
{
|
31 |
-
return
|
32 |
-
($this->product instanceof Mage_Catalog_Model_Product);
|
33 |
}
|
34 |
|
35 |
/**
|
@@ -39,11 +30,12 @@ class Converdo_Tracker_Processor_ProductViewProcessor extends Converdo_Tracker_P
|
|
39 |
*/
|
40 |
public function process()
|
41 |
{
|
42 |
-
$this->product = new Converdo_Entity_Product(
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
|
|
|
47 |
|
48 |
$this->configuration();
|
49 |
}
|
@@ -96,6 +88,9 @@ class Converdo_Tracker_Processor_ProductViewProcessor extends Converdo_Tracker_P
|
|
96 |
// Product Id
|
97 |
'rid' => $this->product->getId(),
|
98 |
|
|
|
|
|
|
|
99 |
// Product Type
|
100 |
'typ' => $this->product->getType(),
|
101 |
|
@@ -112,4 +107,15 @@ class Converdo_Tracker_Processor_ProductViewProcessor extends Converdo_Tracker_P
|
|
112 |
'pco' => null,
|
113 |
]);
|
114 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
}
|
3 |
class Converdo_Tracker_Processor_ProductViewProcessor extends Converdo_Tracker_Processor_AbstractProcessor
|
4 |
{
|
5 |
/**
|
6 |
+
* @var Converdo_Entity_Product
|
7 |
*/
|
8 |
protected $product;
|
9 |
|
12 |
*/
|
13 |
protected $categories = [];
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
/**
|
16 |
* Get whether the processor is responsible for the job.
|
17 |
*
|
20 |
*/
|
21 |
public function responsible(Converdo_Analytics_Block_Tracker $block)
|
22 |
{
|
23 |
+
return Mage::registry('current_product');
|
|
|
24 |
}
|
25 |
|
26 |
/**
|
30 |
*/
|
31 |
public function process()
|
32 |
{
|
33 |
+
$this->product = new Converdo_Entity_Product(Mage::registry('current_product'));
|
34 |
|
35 |
+
Converdo_Support_QueryParser::entity($this->product);
|
36 |
+
Converdo_Support_QueryParser::add(new Converdo_Tracker_Query_ProductView, [
|
37 |
+
2 => [Converdo_Support_QueryType::string(), implode(', ', $this->categories())],
|
38 |
+
]);
|
39 |
|
40 |
$this->configuration();
|
41 |
}
|
88 |
// Product Id
|
89 |
'rid' => $this->product->getId(),
|
90 |
|
91 |
+
// Product Children Id
|
92 |
+
'tid' => $this->children(),
|
93 |
+
|
94 |
// Product Type
|
95 |
'typ' => $this->product->getType(),
|
96 |
|
107 |
'pco' => null,
|
108 |
]);
|
109 |
}
|
110 |
+
|
111 |
+
protected function children()
|
112 |
+
{
|
113 |
+
$children = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($this->product->getId());
|
114 |
+
|
115 |
+
if (! count($children) || ! isset($children[0])) {
|
116 |
+
return null;
|
117 |
+
}
|
118 |
+
|
119 |
+
return array_keys($children[0]);
|
120 |
+
}
|
121 |
}
|
lib/Converdo/Tracker/Query/AbstractQuery.php
CHANGED
@@ -3,27 +3,26 @@
|
|
3 |
abstract class Converdo_Tracker_Query_AbstractQuery implements Converdo_Tracker_Query_Interface_QueryInterface
|
4 |
{
|
5 |
/**
|
6 |
-
* @var Varien_Object
|
7 |
*/
|
8 |
-
protected $
|
9 |
|
10 |
/**
|
11 |
-
*
|
12 |
-
*
|
13 |
-
* @param Varien_Object $entity
|
14 |
-
* @return void
|
15 |
*/
|
16 |
-
public function
|
17 |
{
|
18 |
-
$this->
|
|
|
|
|
19 |
}
|
20 |
|
21 |
/**
|
22 |
-
*
|
23 |
-
*
|
24 |
* @return array
|
25 |
*/
|
26 |
-
public function
|
27 |
{
|
28 |
return [];
|
29 |
}
|
3 |
abstract class Converdo_Tracker_Query_AbstractQuery implements Converdo_Tracker_Query_Interface_QueryInterface
|
4 |
{
|
5 |
/**
|
6 |
+
* @var Varien_Object[]
|
7 |
*/
|
8 |
+
protected $entities = [];
|
9 |
|
10 |
/**
|
11 |
+
* @inheritdoc
|
12 |
+
* @return $this
|
|
|
|
|
13 |
*/
|
14 |
+
public function with(array $entities = [])
|
15 |
{
|
16 |
+
$this->entities = array_merge($this->entities, $entities);
|
17 |
+
|
18 |
+
return $this;
|
19 |
}
|
20 |
|
21 |
/**
|
22 |
+
* @inheritdoc
|
|
|
23 |
* @return array
|
24 |
*/
|
25 |
+
public function parameters()
|
26 |
{
|
27 |
return [];
|
28 |
}
|
lib/Converdo/Tracker/Query/CategoryView.php
CHANGED
@@ -3,30 +3,24 @@
|
|
3 |
class Converdo_Tracker_Query_CategoryView extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
/**
|
6 |
-
*
|
7 |
-
*
|
8 |
-
* @return mixed
|
9 |
*/
|
10 |
-
public function
|
11 |
{
|
12 |
return 'setEcommerceView';
|
13 |
}
|
14 |
|
15 |
/**
|
16 |
-
*
|
17 |
-
*
|
18 |
* @return array
|
19 |
*/
|
20 |
-
public function
|
21 |
{
|
22 |
-
if (!($this->entity instanceof Mage_Catalog_Model_Category)) {
|
23 |
-
return [];
|
24 |
-
}
|
25 |
-
|
26 |
return [
|
27 |
-
0 =>
|
28 |
-
1 =>
|
29 |
-
2 => $this->
|
30 |
];
|
31 |
}
|
32 |
}
|
3 |
class Converdo_Tracker_Query_CategoryView extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
/**
|
6 |
+
* @inheritdoc
|
7 |
+
* @return string
|
|
|
8 |
*/
|
9 |
+
public function view()
|
10 |
{
|
11 |
return 'setEcommerceView';
|
12 |
}
|
13 |
|
14 |
/**
|
15 |
+
* @inheritdoc
|
|
|
16 |
* @return array
|
17 |
*/
|
18 |
+
public function parameters()
|
19 |
{
|
|
|
|
|
|
|
|
|
20 |
return [
|
21 |
+
0 => [Converdo_Support_QueryType::null()],
|
22 |
+
1 => [Converdo_Support_QueryType::null()],
|
23 |
+
2 => [Converdo_Support_QueryType::string(), $this->entities[0]->getName()],
|
24 |
];
|
25 |
}
|
26 |
}
|
lib/Converdo/Tracker/Query/CustomVariable.php
CHANGED
@@ -3,25 +3,23 @@
|
|
3 |
class Converdo_Tracker_Query_CustomVariable extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
/**
|
6 |
-
*
|
7 |
-
*
|
8 |
-
* @return mixed
|
9 |
*/
|
10 |
-
public function
|
11 |
{
|
12 |
return 'setCustomVariable';
|
13 |
}
|
14 |
|
15 |
/**
|
16 |
-
*
|
17 |
-
*
|
18 |
* @return array
|
19 |
*/
|
20 |
-
public function
|
21 |
{
|
22 |
return [
|
23 |
-
0 => 1,
|
24 |
-
1 => 'configuration',
|
25 |
];
|
26 |
}
|
27 |
}
|
3 |
class Converdo_Tracker_Query_CustomVariable extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
/**
|
6 |
+
* @inheritdoc
|
7 |
+
* @return string
|
|
|
8 |
*/
|
9 |
+
public function view()
|
10 |
{
|
11 |
return 'setCustomVariable';
|
12 |
}
|
13 |
|
14 |
/**
|
15 |
+
* @inheritdoc
|
|
|
16 |
* @return array
|
17 |
*/
|
18 |
+
public function parameters()
|
19 |
{
|
20 |
return [
|
21 |
+
0 => [Converdo_Support_QueryType::integer(), 1],
|
22 |
+
1 => [Converdo_Support_QueryType::string(), 'configuration'],
|
23 |
];
|
24 |
}
|
25 |
}
|
lib/Converdo/Tracker/Query/EcommerceCartUpdate.php
CHANGED
@@ -2,19 +2,27 @@
|
|
2 |
|
3 |
class Converdo_Tracker_Query_EcommerceCartUpdate extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
-
|
|
|
|
|
|
|
|
|
6 |
{
|
7 |
return 'trackEcommerceCartUpdate';
|
8 |
}
|
9 |
|
10 |
-
|
|
|
|
|
|
|
|
|
11 |
{
|
12 |
-
if (!($this->
|
13 |
return [];
|
14 |
}
|
15 |
|
16 |
return [
|
17 |
-
0
|
18 |
];
|
19 |
}
|
20 |
}
|
2 |
|
3 |
class Converdo_Tracker_Query_EcommerceCartUpdate extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
+
/**
|
6 |
+
* @inheritdoc
|
7 |
+
* @return string
|
8 |
+
*/
|
9 |
+
public function view()
|
10 |
{
|
11 |
return 'trackEcommerceCartUpdate';
|
12 |
}
|
13 |
|
14 |
+
/**
|
15 |
+
* @inheritdoc
|
16 |
+
* @return array
|
17 |
+
*/
|
18 |
+
public function parameters()
|
19 |
{
|
20 |
+
if (!($this->entities[0] instanceof Varien_Object)) {
|
21 |
return [];
|
22 |
}
|
23 |
|
24 |
return [
|
25 |
+
0 => [Converdo_Support_QueryType::float(), number_format($this->entities[0]->getQuote()->getGrandTotal(), 2)],
|
26 |
];
|
27 |
}
|
28 |
}
|
lib/Converdo/Tracker/Query/EcommerceItem.php
CHANGED
@@ -8,30 +8,24 @@ class Converdo_Tracker_Query_EcommerceItem extends Converdo_Tracker_Query_Abstra
|
|
8 |
protected $entity;
|
9 |
|
10 |
/**
|
11 |
-
*
|
12 |
-
*
|
13 |
-
* @return mixed
|
14 |
*/
|
15 |
-
public function
|
16 |
{
|
17 |
return 'addEcommerceItem';
|
18 |
}
|
19 |
|
20 |
/**
|
21 |
-
*
|
22 |
-
*
|
23 |
* @return array
|
24 |
*/
|
25 |
-
public function
|
26 |
{
|
27 |
-
if (!($this->entity instanceof Converdo_Entity_Interface_EntityInterface)) {
|
28 |
-
return [];
|
29 |
-
}
|
30 |
-
|
31 |
return [
|
32 |
-
0 => $this->
|
33 |
-
1 => $this->
|
34 |
-
3 => $this->
|
35 |
];
|
36 |
}
|
37 |
}
|
8 |
protected $entity;
|
9 |
|
10 |
/**
|
11 |
+
* @inheritdoc
|
12 |
+
* @return string
|
|
|
13 |
*/
|
14 |
+
public function view()
|
15 |
{
|
16 |
return 'addEcommerceItem';
|
17 |
}
|
18 |
|
19 |
/**
|
20 |
+
* @inheritdoc
|
|
|
21 |
* @return array
|
22 |
*/
|
23 |
+
public function parameters()
|
24 |
{
|
|
|
|
|
|
|
|
|
25 |
return [
|
26 |
+
0 => [Converdo_Support_QueryType::string(), $this->entities[0]->getSku()],
|
27 |
+
1 => [Converdo_Support_QueryType::string(), $this->entities[0]->getName()],
|
28 |
+
3 => [Converdo_Support_QueryType::float(), $this->entities[0]->getPrice()],
|
29 |
];
|
30 |
}
|
31 |
}
|
lib/Converdo/Tracker/Query/EcommerceTracking.php
CHANGED
@@ -2,7 +2,11 @@
|
|
2 |
|
3 |
class Converdo_Tracker_Query_EcommerceTracking extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
-
|
|
|
|
|
|
|
|
|
6 |
{
|
7 |
return 'trackEcommerceOrder';
|
8 |
}
|
2 |
|
3 |
class Converdo_Tracker_Query_EcommerceTracking extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
+
/**
|
6 |
+
* @inheritdoc
|
7 |
+
* @return string
|
8 |
+
*/
|
9 |
+
public function view()
|
10 |
{
|
11 |
return 'trackEcommerceOrder';
|
12 |
}
|
lib/Converdo/Tracker/Query/EcommerceView.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Converdo_Tracker_Query_EcommerceView extends Converdo_Tracker_Query_AbstractQuery
|
4 |
-
{
|
5 |
-
public function getView()
|
6 |
-
{
|
7 |
-
return 'setEcommerceView';
|
8 |
-
}
|
9 |
-
|
10 |
-
public function getData()
|
11 |
-
{
|
12 |
-
if (!($this->entity instanceof Varien_Object)) {
|
13 |
-
return [];
|
14 |
-
}
|
15 |
-
|
16 |
-
return [
|
17 |
-
0 => $this->entity->getSku(),
|
18 |
-
1 => addslashes($this->entity->getName()),
|
19 |
-
2 => $this->entity->getName(),
|
20 |
-
3 => number_format($this->entity->getPrice(), 2),
|
21 |
-
4 => number_format($this->entity->getQtyOrdered(), 0, '.', ''),
|
22 |
-
];
|
23 |
-
}
|
24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Converdo/Tracker/Query/HeartBeat.php
CHANGED
@@ -2,7 +2,11 @@
|
|
2 |
|
3 |
class Converdo_Tracker_Query_HeartBeat extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
-
|
|
|
|
|
|
|
|
|
6 |
{
|
7 |
return 'enableHeartBeatTimer';
|
8 |
}
|
2 |
|
3 |
class Converdo_Tracker_Query_HeartBeat extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
+
/**
|
6 |
+
* @inheritdoc
|
7 |
+
* @return string
|
8 |
+
*/
|
9 |
+
public function view()
|
10 |
{
|
11 |
return 'enableHeartBeatTimer';
|
12 |
}
|
lib/Converdo/Tracker/Query/Interface/QueryInterface.php
CHANGED
@@ -3,24 +3,24 @@
|
|
3 |
interface Converdo_Tracker_Query_Interface_QueryInterface
|
4 |
{
|
5 |
/**
|
6 |
-
*
|
7 |
*
|
8 |
* @return mixed
|
9 |
*/
|
10 |
-
public function
|
11 |
|
12 |
/**
|
13 |
-
*
|
14 |
*
|
15 |
* @return array
|
16 |
*/
|
17 |
-
public function
|
18 |
|
19 |
/**
|
20 |
-
* Pass
|
21 |
*
|
22 |
-
* @param
|
23 |
-
* @return
|
24 |
*/
|
25 |
-
public function
|
26 |
}
|
3 |
interface Converdo_Tracker_Query_Interface_QueryInterface
|
4 |
{
|
5 |
/**
|
6 |
+
* Returns the query key.
|
7 |
*
|
8 |
* @return mixed
|
9 |
*/
|
10 |
+
public function view();
|
11 |
|
12 |
/**
|
13 |
+
* Returns the query parameters.
|
14 |
*
|
15 |
* @return array
|
16 |
*/
|
17 |
+
public function parameters();
|
18 |
|
19 |
/**
|
20 |
+
* Pass additional data to the query.
|
21 |
*
|
22 |
+
* @param array $entities
|
23 |
+
* @return $this
|
24 |
*/
|
25 |
+
public function with(array $entities = []);
|
26 |
}
|
lib/Converdo/Tracker/Query/LinkTracking.php
CHANGED
@@ -2,7 +2,11 @@
|
|
2 |
|
3 |
class Converdo_Tracker_Query_LinkTracking extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
-
|
|
|
|
|
|
|
|
|
6 |
{
|
7 |
return 'enableLinkTracking';
|
8 |
}
|
2 |
|
3 |
class Converdo_Tracker_Query_LinkTracking extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
+
/**
|
6 |
+
* @inheritdoc
|
7 |
+
* @return string
|
8 |
+
*/
|
9 |
+
public function view()
|
10 |
{
|
11 |
return 'enableLinkTracking';
|
12 |
}
|
lib/Converdo/Tracker/Query/PageTracking.php
CHANGED
@@ -3,11 +3,10 @@
|
|
3 |
class Converdo_Tracker_Query_PageTracking extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
/**
|
6 |
-
*
|
7 |
-
*
|
8 |
-
* @return mixed
|
9 |
*/
|
10 |
-
public function
|
11 |
{
|
12 |
return 'trackPageView';
|
13 |
}
|
3 |
class Converdo_Tracker_Query_PageTracking extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
/**
|
6 |
+
* @inheritdoc
|
7 |
+
* @return string
|
|
|
8 |
*/
|
9 |
+
public function view()
|
10 |
{
|
11 |
return 'trackPageView';
|
12 |
}
|
lib/Converdo/Tracker/Query/PageView.php
CHANGED
@@ -3,25 +3,23 @@
|
|
3 |
class Converdo_Tracker_Query_PageView extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
/**
|
6 |
-
*
|
7 |
-
*
|
8 |
-
* @return mixed
|
9 |
*/
|
10 |
-
public function
|
11 |
{
|
12 |
return 'setCustomVariable';
|
13 |
}
|
14 |
|
15 |
/**
|
16 |
-
*
|
17 |
-
*
|
18 |
* @return array
|
19 |
*/
|
20 |
-
public function
|
21 |
{
|
22 |
return [
|
23 |
-
0 => 1,
|
24 |
-
1 => 'configuration',
|
25 |
];
|
26 |
}
|
27 |
}
|
3 |
class Converdo_Tracker_Query_PageView extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
/**
|
6 |
+
* @inheritdoc
|
7 |
+
* @return string
|
|
|
8 |
*/
|
9 |
+
public function view()
|
10 |
{
|
11 |
return 'setCustomVariable';
|
12 |
}
|
13 |
|
14 |
/**
|
15 |
+
* @inheritdoc
|
|
|
16 |
* @return array
|
17 |
*/
|
18 |
+
public function parameters()
|
19 |
{
|
20 |
return [
|
21 |
+
0 => [Converdo_Support_QueryType::integer(), 1],
|
22 |
+
1 => [Converdo_Support_QueryType::string(), 'configuration'],
|
23 |
];
|
24 |
}
|
25 |
}
|
lib/Converdo/Tracker/Query/ProductView.php
CHANGED
@@ -3,30 +3,24 @@
|
|
3 |
class Converdo_Tracker_Query_ProductView extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
/**
|
6 |
-
*
|
7 |
-
*
|
8 |
-
* @return mixed
|
9 |
*/
|
10 |
-
public function
|
11 |
{
|
12 |
return 'setEcommerceView';
|
13 |
}
|
14 |
|
15 |
/**
|
16 |
-
*
|
17 |
-
*
|
18 |
* @return array
|
19 |
*/
|
20 |
-
public function
|
21 |
{
|
22 |
-
if (!($this->entity instanceof Converdo_Entity_Interface_EntityInterface)) {
|
23 |
-
return [];
|
24 |
-
}
|
25 |
-
|
26 |
return [
|
27 |
-
0 => $this->
|
28 |
-
1 => $this->
|
29 |
-
3 => $this->
|
30 |
];
|
31 |
}
|
32 |
}
|
3 |
class Converdo_Tracker_Query_ProductView extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
/**
|
6 |
+
* @inheritdoc
|
7 |
+
* @return string
|
|
|
8 |
*/
|
9 |
+
public function view()
|
10 |
{
|
11 |
return 'setEcommerceView';
|
12 |
}
|
13 |
|
14 |
/**
|
15 |
+
* @inheritdoc
|
|
|
16 |
* @return array
|
17 |
*/
|
18 |
+
public function parameters()
|
19 |
{
|
|
|
|
|
|
|
|
|
20 |
return [
|
21 |
+
0 => [Converdo_Support_QueryType::string(), $this->entities[0]->getSku()],
|
22 |
+
1 => [Converdo_Support_QueryType::string(), addslashes($this->entities[0]->getName())],
|
23 |
+
3 => [Converdo_Support_QueryType::float(), number_format($this->entities[0]->getPrice(), 2)],
|
24 |
];
|
25 |
}
|
26 |
}
|
lib/Converdo/Tracker/Query/SiteId.php
CHANGED
@@ -3,24 +3,22 @@
|
|
3 |
class Converdo_Tracker_Query_SiteId extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
/**
|
6 |
-
*
|
7 |
-
*
|
8 |
-
* @return mixed
|
9 |
*/
|
10 |
-
public function
|
11 |
{
|
12 |
return 'setSiteId';
|
13 |
}
|
14 |
|
15 |
/**
|
16 |
-
*
|
17 |
-
*
|
18 |
* @return array
|
19 |
*/
|
20 |
-
public function
|
21 |
{
|
22 |
return [
|
23 |
-
0 =>
|
24 |
];
|
25 |
}
|
26 |
}
|
3 |
class Converdo_Tracker_Query_SiteId extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
/**
|
6 |
+
* @inheritdoc
|
7 |
+
* @return string
|
|
|
8 |
*/
|
9 |
+
public function view()
|
10 |
{
|
11 |
return 'setSiteId';
|
12 |
}
|
13 |
|
14 |
/**
|
15 |
+
* @inheritdoc
|
|
|
16 |
* @return array
|
17 |
*/
|
18 |
+
public function parameters()
|
19 |
{
|
20 |
return [
|
21 |
+
0 => [Converdo_Support_QueryType::string(), Converdo_Analytics_Helper_Data::getSiteId()],
|
22 |
];
|
23 |
}
|
24 |
}
|
lib/Converdo/Tracker/Query/TrackerUrl.php
CHANGED
@@ -3,37 +3,22 @@
|
|
3 |
class Converdo_Tracker_Query_TrackerUrl extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
/**
|
6 |
-
* @
|
|
|
7 |
*/
|
8 |
-
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Converdo_Tracker_Query_TrackerUrl constructor.
|
12 |
-
*/
|
13 |
-
public function __construct()
|
14 |
-
{
|
15 |
-
$this->helper = new Converdo_Analytics_Helper_Data;
|
16 |
-
}
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Get the view.
|
20 |
-
*
|
21 |
-
* @return mixed
|
22 |
-
*/
|
23 |
-
public function getView()
|
24 |
{
|
25 |
return 'setTrackerUrl';
|
26 |
}
|
27 |
|
28 |
/**
|
29 |
-
*
|
30 |
-
*
|
31 |
* @return array
|
32 |
*/
|
33 |
-
public function
|
34 |
{
|
35 |
return [
|
36 |
-
0
|
37 |
];
|
38 |
}
|
39 |
}
|
3 |
class Converdo_Tracker_Query_TrackerUrl extends Converdo_Tracker_Query_AbstractQuery
|
4 |
{
|
5 |
/**
|
6 |
+
* @inheritdoc
|
7 |
+
* @return string
|
8 |
*/
|
9 |
+
public function view()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
{
|
11 |
return 'setTrackerUrl';
|
12 |
}
|
13 |
|
14 |
/**
|
15 |
+
* @inheritdoc
|
|
|
16 |
* @return array
|
17 |
*/
|
18 |
+
public function parameters()
|
19 |
{
|
20 |
return [
|
21 |
+
0 => [Converdo_Support_QueryType::string(), Converdo_Analytics_Helper_Data::getPhpTracker(true)],
|
22 |
];
|
23 |
}
|
24 |
}
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Converdo_Analytics</name>
|
4 |
-
<version>1.2.
|
5 |
<stability>stable</stability>
|
6 |
<license>MITL</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
10 |
<description>Better E-commerce Analytics. Clear, actionable insight in the behavior of your visitors. Improve your campaigns and conversion rate easily. This plugin, installed in a minute, is all you need to have a complete and powerfull Analytics Suite. View your KPI's and sales funnels, segmented on dozens of dimensions like page type, device, landing page, campaign, etc. This plugin collects your users behaviour so you can view the insights on your dashboard on converdo.com. You can use Converdo Analytics side by side with Google Analytics without a problem. It works asynchronous so it will never impact your user experience. This extension is made especially for Magento ecommerce stores, which provides you powerfull insights out of the box.</description>
|
11 |
<notes>- Small improvements.</notes>
|
12 |
<authors><author><name>Roeland van Oostenbrugge</name><user>converdo</user><email>roeland@converdo.nl</email></author></authors>
|
13 |
-
<date>2016-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Converdo"><dir name="Analytics"><dir name="Block"><file name="Tracker.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.5.37</min><max>7.0.5</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Converdo_Analytics</name>
|
4 |
+
<version>1.2.4.5</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>MITL</license>
|
7 |
<channel>community</channel>
|
10 |
<description>Better E-commerce Analytics. Clear, actionable insight in the behavior of your visitors. Improve your campaigns and conversion rate easily. This plugin, installed in a minute, is all you need to have a complete and powerfull Analytics Suite. View your KPI's and sales funnels, segmented on dozens of dimensions like page type, device, landing page, campaign, etc. This plugin collects your users behaviour so you can view the insights on your dashboard on converdo.com. You can use Converdo Analytics side by side with Google Analytics without a problem. It works asynchronous so it will never impact your user experience. This extension is made especially for Magento ecommerce stores, which provides you powerfull insights out of the box.</description>
|
11 |
<notes>- Small improvements.</notes>
|
12 |
<authors><author><name>Roeland van Oostenbrugge</name><user>converdo</user><email>roeland@converdo.nl</email></author></authors>
|
13 |
+
<date>2016-12-01</date>
|
14 |
+
<time>10:35:34</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Converdo"><dir name="Analytics"><dir name="Block"><file name="Tracker.php" hash="06d7c9820995a4822b5c65b23b34705d"/></dir><dir name="Helper"><file name="Data.php" hash="c4d21c9630645736d2ea741d4536dd91"/></dir><dir name="Model"><file name="Observer.php" hash="0b1e93efcb995705bda3c99a136f66ae"/></dir><dir name="controllers"><file name="PingController.php" hash="75cd32ba2a0fb49df2753dac65bd6a6c"/></dir><dir name="etc"><file name="adminhtml.xml" hash="9923bfe8c0f4aa318166e15cd373cf09"/><file name="config.xml" hash="d44e06b725878f8f7a8ee98055767042"/><file name="system.xml" hash="46aa892340c8cafe438979c051892002"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="analytics.xml" hash="d3f9d35df1981968a55a331c2b92d473"/></dir><dir name="template"><dir name="analytics"><file name="analytics.phtml" hash="530da01ace4c4a2c51ebb2048c3ef548"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><file name="converdoanalytics.xml" hash=""/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Converdo_Analytics.xml" hash="119a038ca81bdf03767b1b12d81414ad"/></dir></target><target name="magelib"><dir name="Converdo"><dir name="Entity"><file name="AbstractEntity.php" hash="4130576c917771fdafcb4055363b2861"/><dir name="Interface"><file name="EntityInterface.php" hash="cb6a4e6da90518a9ffa8445314de56c1"/><file name="ProductInterface.php" hash="6245b2cadfec44d4965f2d93f9241b55"/></dir><file name="Product.php" hash="bf5701920a15f6426547e0f7e1321ccd"/></dir><dir name="Support"><file name="Crypt.php" hash="265f44cafba70116f72c255dd737a805"/><file name="QueryParser.php" hash="923510ed87625afe094945b787462ef0"/><file name="QueryType.php" hash="ba9a87192c533cb0faf693f5921775c0"/><file name="StringBuilder.php" hash="282b1a3111f7cdf4c3b88f6320a8c57e"/></dir><dir name="Tracker"><dir name="Processor"><file name="AbstractProcessor.php" hash="f60b81c634540985822b30207f41913e"/><file name="CartProcessor.php" hash="d2709554c310b9cbcff93d99d0a9ac4e"/><file name="CategoryViewProcessor.php" hash="7eb98e452fa38adb49d1405e3204944a"/><file name="CheckoutProcessor.php" hash="237a103653c10db36d1533fa4a9928b0"/><file name="CustomVariableProcessor.php" hash="e01aaec7bafce588cd229e9778a8b1c5"/><file name="FootProcessor.php" hash="b1dbccbc34a6fa541ba9e2ff0ef6adfc"/><file name="HeadProcessor.php" hash="bdf476a4bfcd18d22de9d566ca2c9911"/><dir name="Interface"><file name="ProcessorInterface.php" hash="b4d97a90b6110c09a2bac67ffa4f6634"/></dir><file name="PageViewProcessor.php" hash="cc2c4bc1e163e13a1168196dd70f526a"/><file name="ProductViewProcessor.php" hash="18e27fd54953834beb3d487c23db7027"/></dir><dir name="Query"><file name="AbstractQuery.php" hash="9e3348f213c16c42abdd986eaef931b7"/><file name="CategoryView.php" hash="2af31b374e711793a8538fb4f404b57f"/><file name="CustomVariable.php" hash="41731818f3701f6e9eab715303e19fa9"/><file name="EcommerceCartUpdate.php" hash="3bd3703e76d040d2ad23653dca406822"/><file name="EcommerceItem.php" hash="24ecf22827962044f643eb5d6826ab58"/><file name="EcommerceTracking.php" hash="5f03f4080b138b0b3d97cf36f61a72a4"/><file name="HeartBeat.php" hash="de13ea2b63e5331bd743a6b0a9285426"/><dir name="Interface"><file name="QueryInterface.php" hash="5c80f20d543987cd3af1a74639fdd2ed"/></dir><file name="LinkTracking.php" hash="8991e3486eb1f21330d3377e8f651b79"/><file name="PageTracking.php" hash="07ac787d1f1feb10299a41caedb9acdb"/><file name="PageView.php" hash="768a0f2d004fa0172f46606f66578a8a"/><file name="ProductView.php" hash="75ee3c9da31fa6956c5c89d32931d3c3"/><file name="SiteId.php" hash="1181099e00e826fe5d62ad6adb0fff4b"/><file name="TrackerUrl.php" hash="e4912db7d801eff50ed701be7dc6c0a8"/></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Converdo_Magento.csv" hash=""/></dir><dir name="nl_NL"><file name="Converdo_Magento.csv" hash=""/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="converdoanalytics"><dir name="css"><file name="system_config_edit.css" hash="fd6f5337fd9a9b69b85079e17aa0e40b"/></dir><dir name="images"><file name="favicon.png" hash="674c9388eba1ea89e200fe6b1a62fc24"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.5.37</min><max>7.0.5</max></php></required></dependencies>
|
18 |
</package>
|
skin/adminhtml/default/default/converdoanalytics/css/system_config_edit.css
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#system_config_tabs .converdo-analytics-tab { background:transparent url(../images/favicon.png) 18px 3px no-repeat !important; display:block; height:33px; }
|
2 |
+
#system_config_tabs .converdo-analytics-tab:hover { background-color:#d8e6e6 !important; border-right:1px solid #8aa5a6; }
|
3 |
+
#system_config_tabs .converdo-analytics-tab.active { background-color:#fff !important; border-right:none !important; }
|
4 |
+
#system_config_tabs .converdo-analytics-tab span { padding:7px 0 1px 47px; display:block; height:25px; }
|
5 |
+
#system_config_tabs .converdo-analytics-tab.active span { background:none; }
|
skin/adminhtml/default/default/converdoanalytics/images/favicon.png
ADDED
Binary file
|