Version Notes
- Fix some minor issues
- Add some comments to the code
Download this release
Release Info
Developer | Moe Ghashim |
Extension | Shopgo_Totango |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.1
app/code/community/Shopgo/Totango/Helper/Data.php
CHANGED
@@ -147,8 +147,6 @@ class Shopgo_Totango_Helper_Data extends Shopgo_Core_Helper_Abstract
|
|
147 |
|
148 |
switch ($trackersActive) {
|
149 |
case self::TRACKERS_ACTIVE_NONE:
|
150 |
-
$result = false;
|
151 |
-
|
152 |
$this->log(array(
|
153 |
'message' => 'All trackers are inactive/disabled',
|
154 |
'level' => 5
|
@@ -167,7 +165,7 @@ class Shopgo_Totango_Helper_Data extends Shopgo_Core_Helper_Abstract
|
|
167 |
break;
|
168 |
|
169 |
default:
|
170 |
-
$trackers = self::getTrackers();
|
171 |
|
172 |
if (isset($trackers[$tracker])) {
|
173 |
$result = $this->getConfig(
|
@@ -323,6 +321,8 @@ class Shopgo_Totango_Helper_Data extends Shopgo_Core_Helper_Abstract
|
|
323 |
));
|
324 |
|
325 |
if (trim($config) != '') {
|
|
|
|
|
326 |
break;
|
327 |
}
|
328 |
} else {
|
@@ -336,8 +336,6 @@ class Shopgo_Totango_Helper_Data extends Shopgo_Core_Helper_Abstract
|
|
336 |
));
|
337 |
}
|
338 |
|
339 |
-
// Break is omitted on purpose
|
340 |
-
|
341 |
case false:
|
342 |
// It looks a bit odd, but this is a necessary check
|
343 |
if (!$persistLocal->hasFile) {
|
@@ -354,7 +352,7 @@ class Shopgo_Totango_Helper_Data extends Shopgo_Core_Helper_Abstract
|
|
354 |
} else {
|
355 |
$this->log(array(
|
356 |
'message' => sprintf(
|
357 |
-
'Persist config
|
358 |
'is invalid or does not exist',
|
359 |
$path
|
360 |
),
|
147 |
|
148 |
switch ($trackersActive) {
|
149 |
case self::TRACKERS_ACTIVE_NONE:
|
|
|
|
|
150 |
$this->log(array(
|
151 |
'message' => 'All trackers are inactive/disabled',
|
152 |
'level' => 5
|
165 |
break;
|
166 |
|
167 |
default:
|
168 |
+
$trackers = array_flip(self::getTrackers());
|
169 |
|
170 |
if (isset($trackers[$tracker])) {
|
171 |
$result = $this->getConfig(
|
321 |
));
|
322 |
|
323 |
if (trim($config) != '') {
|
324 |
+
// Break only if a persist config "local"
|
325 |
+
// value is found.
|
326 |
break;
|
327 |
}
|
328 |
} else {
|
336 |
));
|
337 |
}
|
338 |
|
|
|
|
|
339 |
case false:
|
340 |
// It looks a bit odd, but this is a necessary check
|
341 |
if (!$persistLocal->hasFile) {
|
352 |
} else {
|
353 |
$this->log(array(
|
354 |
'message' => sprintf(
|
355 |
+
'Persist config path (%s) ' .
|
356 |
'is invalid or does not exist',
|
357 |
$path
|
358 |
),
|
app/code/community/Shopgo/Totango/Model/Observer.php
CHANGED
@@ -59,9 +59,7 @@ class Shopgo_Totango_Model_Observer
|
|
59 |
return;
|
60 |
}
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
if (!isset($orderStatesNames[$orderState])) {
|
65 |
$helper->log(array(
|
66 |
'message' => sprintf(
|
67 |
'%s orders are not trackable',
|
@@ -75,6 +73,9 @@ class Shopgo_Totango_Model_Observer
|
|
75 |
|
76 |
foreach ($orderStates as $state => $data) {
|
77 |
if ($helper->isTrackerEnabled($data['tracker-name'])) {
|
|
|
|
|
|
|
78 |
$orders = Mage::getModel('sales/order')
|
79 |
->getCollection()
|
80 |
->addAttributeToFilter('status', array(
|
@@ -160,6 +161,8 @@ class Shopgo_Totango_Model_Observer
|
|
160 |
->getCollection()
|
161 |
->getAllIds();
|
162 |
|
|
|
|
|
163 |
if (!isset($categories[$categoryId])) {
|
164 |
$categoriesCount = Mage::getModel('catalog/category')
|
165 |
->getCollection()->getSize();
|
@@ -330,7 +333,9 @@ class Shopgo_Totango_Model_Observer
|
|
330 |
$adminUser = $observer->getUser();
|
331 |
$adminUsername = $adminUser->getUsername();
|
332 |
|
333 |
-
$excludedAdminUsers =
|
|
|
|
|
334 |
|
335 |
if (!isset($excludedAdminUsers[$adminUsername])) {
|
336 |
// New login is not counted in this event.
|
59 |
return;
|
60 |
}
|
61 |
|
62 |
+
if (!isset($orderStates[$orderState])) {
|
|
|
|
|
63 |
$helper->log(array(
|
64 |
'message' => sprintf(
|
65 |
'%s orders are not trackable',
|
73 |
|
74 |
foreach ($orderStates as $state => $data) {
|
75 |
if ($helper->isTrackerEnabled($data['tracker-name'])) {
|
76 |
+
// The following line which is used inside
|
77 |
+
// a for loop is a bit expensive!
|
78 |
+
// I might look for a possible workaround later.
|
79 |
$orders = Mage::getModel('sales/order')
|
80 |
->getCollection()
|
81 |
->addAttributeToFilter('status', array(
|
161 |
->getCollection()
|
162 |
->getAllIds();
|
163 |
|
164 |
+
$categories = array_flip($categories);
|
165 |
+
|
166 |
if (!isset($categories[$categoryId])) {
|
167 |
$categoriesCount = Mage::getModel('catalog/category')
|
168 |
->getCollection()->getSize();
|
333 |
$adminUser = $observer->getUser();
|
334 |
$adminUsername = $adminUser->getUsername();
|
335 |
|
336 |
+
$excludedAdminUsers = array_flip(
|
337 |
+
$helper->getExcludedAdminUsers()
|
338 |
+
);
|
339 |
|
340 |
if (!isset($excludedAdminUsers[$adminUsername])) {
|
341 |
// New login is not counted in this event.
|
app/code/community/Shopgo/Totango/etc/config.xml
CHANGED
@@ -24,7 +24,7 @@
|
|
24 |
<config>
|
25 |
<modules>
|
26 |
<Shopgo_Totango>
|
27 |
-
<version>1.0.
|
28 |
</Shopgo_Totango>
|
29 |
</modules>
|
30 |
<global>
|
24 |
<config>
|
25 |
<modules>
|
26 |
<Shopgo_Totango>
|
27 |
+
<version>1.0.1</version>
|
28 |
</Shopgo_Totango>
|
29 |
</modules>
|
30 |
<global>
|
package.xml
CHANGED
@@ -1,27 +1,28 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Shopgo_Totango</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Totango is a module that integrates Magento with Totango tracking service.</summary>
|
10 |
-
<description><p>Totango
|
11 |
-
<h3>What is Totango?</h3>
|
12 |
-
<p>Totango is the leading Customer Engagement platform that helps SaaS companies create an active and engaged user base.</p>
|
13 |
<p>Totango is built on the idea that customer success is all about understanding, measuring, and delivering business value to customers. To do this, Totango’s platform is focused on identifying and monitoring “leading indicators” that help SaaS companies predict at-risk customers and proactively drive positive customer experiences.</p>
|
14 |
<p>Totango pulls in data from multiple systems to assemble a rich profile of every customer, including a predictive health rating and an “engagement score,” which is computed based on data science and machine learning.</p>
|
15 |
<h3>How does it work?</h3>
|
16 |
-
<p>
|
|
|
|
|
17 |
<ul>
|
18 |
-
<li>Track
|
19 |
<li>Track new products.</li>
|
20 |
<li>Track new categories.</li>
|
21 |
<li>Track new attributes.</li>
|
22 |
-
<li>Track enabled
|
23 |
<li>Track enabled payment methods.</li>
|
24 |
<li>Track successful admin logins.</li>
|
|
|
25 |
</ul>
|
26 |
<h3>Dependencies</h3>
|
27 |
<ul>
|
@@ -30,19 +31,23 @@
|
|
30 |
<h3>Notes</h3>
|
31 |
<ul>
|
32 |
<li>Make sure that all dependencies mentioned above are installed before installing this module. Otherwise, it won't work.</li>
|
33 |
-
<li>More trackers
|
34 |
<li>You could customize this module and add your own trackers.</li>
|
35 |
<li>You could use/call this module's helper functions to send tracking calls to Totango.</li>
|
|
|
36 |
</ul>
|
37 |
<p><strong>You could also get the latest version of this module from:</strong><br />
|
38 |
-
<a href="https://github.com/shopgo-
|
39 |
<p><strong>For more info about Totango, visit this website:</strong><br />
|
40 |
<a href="http://www.totango.com/">http://www.totango.com/</a></p></description>
|
41 |
-
<notes
|
|
|
|
|
|
|
42 |
<authors><author><name>ShopGo</name><user>ShopGo</user><email>support@shopgo.me</email></author></authors>
|
43 |
-
<date>2015-
|
44 |
-
<time>
|
45 |
-
<contents><target name="magecommunity"><dir name="Shopgo"><dir name="Totango"><dir name="Helper"><file name="Data.php" hash="
|
46 |
<compatible/>
|
47 |
<dependencies><required><php><min>5.3.0</min><max>7.0.0</max></php><package><name>Shopgo_Core</name><channel>community</channel><min>1.0.7</min><max/></package></required></dependencies>
|
48 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Shopgo_Totango</name>
|
4 |
+
<version>1.0.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Totango is a module that integrates Magento with Totango tracking service.</summary>
|
10 |
+
<description><p>Totango is the leading Customer Engagement platform that helps SaaS companies create an active and engaged user base.</p>
|
|
|
|
|
11 |
<p>Totango is built on the idea that customer success is all about understanding, measuring, and delivering business value to customers. To do this, Totango’s platform is focused on identifying and monitoring “leading indicators” that help SaaS companies predict at-risk customers and proactively drive positive customer experiences.</p>
|
12 |
<p>Totango pulls in data from multiple systems to assemble a rich profile of every customer, including a predictive health rating and an “engagement score,” which is computed based on data science and machine learning.</p>
|
13 |
<h3>How does it work?</h3>
|
14 |
+
<p>The module's job is to monitor and track some users' activities on Magento (e.g. Adding Products, Canceling Orders, ...etc.) and sends tracking data to Totango.</p>
|
15 |
+
<p>It does not have any front end interface, and all of its work is done in the background without noticing it.</p>
|
16 |
+
<h3>Features</h3>
|
17 |
<ul>
|
18 |
+
<li>Track complete and canceled orders.</li>
|
19 |
<li>Track new products.</li>
|
20 |
<li>Track new categories.</li>
|
21 |
<li>Track new attributes.</li>
|
22 |
+
<li>Track enabled shipping methods.</li>
|
23 |
<li>Track enabled payment methods.</li>
|
24 |
<li>Track successful admin logins.</li>
|
25 |
+
<li>Server/Backend Integration (HTTP API).</li>
|
26 |
</ul>
|
27 |
<h3>Dependencies</h3>
|
28 |
<ul>
|
31 |
<h3>Notes</h3>
|
32 |
<ul>
|
33 |
<li>Make sure that all dependencies mentioned above are installed before installing this module. Otherwise, it won't work.</li>
|
34 |
+
<li>More trackers could be added in the future.</li>
|
35 |
<li>You could customize this module and add your own trackers.</li>
|
36 |
<li>You could use/call this module's helper functions to send tracking calls to Totango.</li>
|
37 |
+
<li>Totango Javascript Collector is currently not supported.</li>
|
38 |
</ul>
|
39 |
<p><strong>You could also get the latest version of this module from:</strong><br />
|
40 |
+
<a href="https://github.com/shopgo-magento1/magento-totango-integration">https://github.com/shopgo-magento1/magento-totango-integration</a></p>
|
41 |
<p><strong>For more info about Totango, visit this website:</strong><br />
|
42 |
<a href="http://www.totango.com/">http://www.totango.com/</a></p></description>
|
43 |
+
<notes><ul>
|
44 |
+
<li>Fix some minor issues</li>
|
45 |
+
<li>Add some comments to the code</li>
|
46 |
+
</ul></notes>
|
47 |
<authors><author><name>ShopGo</name><user>ShopGo</user><email>support@shopgo.me</email></author></authors>
|
48 |
+
<date>2015-10-01</date>
|
49 |
+
<time>09:41:50</time>
|
50 |
+
<contents><target name="magecommunity"><dir name="Shopgo"><dir name="Totango"><dir name="Helper"><file name="Data.php" hash="2cc1642ab73fd90e5b77ed1e87667bd4"/></dir><dir name="Model"><file name="Observer.php" hash="003f9eda67ecce9ca3efc160fafcc54c"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Trackersactive.php" hash="7e053d45fd62a4492938dfb006c28c5b"/></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="067f7c3c9b06c50d95c72e392f6b7325"/><file name="config.xml" hash="501b27695186db8c4edff6a2fb23641d"/><file name="system.xml" hash="d83a1e7718af2a8ccfda6dd0f4fd1f1c"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Shopgo_Totango.xml" hash="057d7edbb264eebeaabb61ba002338a9"/></dir></target></contents>
|
51 |
<compatible/>
|
52 |
<dependencies><required><php><min>5.3.0</min><max>7.0.0</max></php><package><name>Shopgo_Core</name><channel>community</channel><min>1.0.7</min><max/></package></required></dependencies>
|
53 |
</package>
|