flowecommerce_resultadosdigitais - Version 0.1.7

Version Notes

Nova forma para adicionar o código de rastreio do RD à loja virtual
Enviando código da storeview junto com as conversões
Forma diferente de recuperação do e-mail na conversão de nova venda, a forma antiga não funcionava em algumas instalações.

Download this release

Release Info

Developer Flow eCommerce
Extension flowecommerce_resultadosdigitais
Version 0.1.7
Comparing to
See all releases


Code changes from version 0.1.6.3 to 0.1.7

app/code/local/Flowecommerce/Resultadosdigitais/Block/Analytics.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Flowecommerce_Resultadosdigitais_Block_Analytics extends Flowecommerce_Resultadosdigitais_Block_Apijs {
4
+
5
+
6
+ }
app/code/local/Flowecommerce/Resultadosdigitais/Block/Apijs.php CHANGED
@@ -20,6 +20,17 @@ class Flowecommerce_Resultadosdigitais_Block_Apijs extends Mage_Core_Block_Templ
20
  return $enabled && $isLoggedIn;
21
  }
22
 
 
 
 
 
 
 
 
 
23
 
 
 
 
24
 
25
  }
20
  return $enabled && $isLoggedIn;
21
  }
22
 
23
+ public function getJsAnalyticsUrl() {
24
+ return $this->helper('resultadosdigitais')->getJsAnalyticsUrl();
25
+ }
26
+
27
+ public function getAnalyticsCode()
28
+ {
29
+ return $this->helper('resultadosdigitais')->getAnalyticsCode();
30
+ }
31
 
32
+ public function isAnalyticsEnabled() {
33
+ return $this->helper('resultadosdigitais')->isAnalyticsEnabled();
34
+ }
35
 
36
  }
app/code/local/Flowecommerce/Resultadosdigitais/Helper/Data.php CHANGED
@@ -18,4 +18,17 @@ class Flowecommerce_Resultadosdigitais_Helper_Data extends Mage_Core_Helper_Abst
18
  return Mage::getStoreConfig('resultadosdigitais/general/jsapurl');
19
  }
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  }
18
  return Mage::getStoreConfig('resultadosdigitais/general/jsapurl');
19
  }
20
 
21
+ public function isAnalyticsEnabled()
22
+ {
23
+ return Mage::getStoreConfigFlag('resultadosdigitais/general/enable_analytics');
24
+ }
25
+
26
+ public function getJsAnalyticsUrl() {
27
+ return Mage::getStoreConfig('resultadosdigitais/general/jsanalyticsurl');
28
+ }
29
+
30
+ public function getAnalyticsCode() {
31
+ return Mage::getStoreConfig('resultadosdigitais/general/analytics_code');
32
+ }
33
+
34
  }
app/code/local/Flowecommerce/Resultadosdigitais/Model/Api.php CHANGED
@@ -84,6 +84,9 @@ class Flowecommerce_Resultadosdigitais_Model_Api
84
  $return['token_rdstation'] = $this->_getHelper()->getToken();
85
  $return['identificador'] = $conversionIdentifier;
86
 
 
 
 
87
  # Utmz
88
  $tracker = Mage::getModel('resultadosdigitais/googleanalytics_tracker');
89
  if ($utmz = $tracker->getUtmZString()) {
@@ -94,6 +97,10 @@ class Flowecommerce_Resultadosdigitais_Model_Api
94
  $return['traffic_source'] = $_COOKIE['__trf_src'];
95
  }
96
 
 
 
 
 
97
  return $return;
98
  }
99
 
84
  $return['token_rdstation'] = $this->_getHelper()->getToken();
85
  $return['identificador'] = $conversionIdentifier;
86
 
87
+ # Código da loja
88
+ $return['store_code'] = Mage::app()->getStore()->getCode();
89
+
90
  # Utmz
91
  $tracker = Mage::getModel('resultadosdigitais/googleanalytics_tracker');
92
  if ($utmz = $tracker->getUtmZString()) {
97
  $return['traffic_source'] = $_COOKIE['__trf_src'];
98
  }
99
 
100
+ if (!empty($_COOKIE['rdtrk'])) {
101
+ $return['client_id'] = json_decode($_COOKIE['rdtrk'])->{'id'};
102
+ }
103
+
104
  return $return;
105
  }
106
 
app/code/local/Flowecommerce/Resultadosdigitais/Model/Observer.php CHANGED
@@ -108,7 +108,7 @@ class Flowecommerce_Resultadosdigitais_Model_Observer {
108
  * Dados da conta
109
  */
110
  $data = $this->_getRequestDataObject();
111
- $data->setEmail($customer->getEmail());
112
  $data->setNome($customer->getName());
113
  $data->setAniversario($customer->getDob());
114
  $data->setGender($this->_getGenderLabel($customer->getGender()));
@@ -182,7 +182,7 @@ class Flowecommerce_Resultadosdigitais_Model_Observer {
182
  $this->_getApi()->addLeadConversion(self::LEAD_ORDERPLACE, $data);
183
 
184
  for ($i = 0; $i <=10; $i++) {
185
- $response = $this->_getApi()->markSale($customer->getEmail(), $order_value);
186
  if ($response) {
187
  $statusResponse = $response->getHeader('Status');
188
  if ($statusResponse == "200 OK") {
108
  * Dados da conta
109
  */
110
  $data = $this->_getRequestDataObject();
111
+ $data->setEmail($order->getCustomerEmail());
112
  $data->setNome($customer->getName());
113
  $data->setAniversario($customer->getDob());
114
  $data->setGender($this->_getGenderLabel($customer->getGender()));
182
  $this->_getApi()->addLeadConversion(self::LEAD_ORDERPLACE, $data);
183
 
184
  for ($i = 0; $i <=10; $i++) {
185
+ $response = $this->_getApi()->markSale($order->getCustomerEmail(), $order_value);
186
  if ($response) {
187
  $statusResponse = $response->getHeader('Status');
188
  if ($statusResponse == "200 OK") {
app/code/local/Flowecommerce/Resultadosdigitais/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Flowecommerce_Resultadosdigitais>
5
- <version>0.1.6</version>
6
  </Flowecommerce_Resultadosdigitais>
7
  </modules>
8
  <global>
@@ -133,6 +133,8 @@
133
  <resultadosdigitais>
134
  <general>
135
  <jsapurl>https://d335luupugsy2.cloudfront.net/js/integration/stable/rd-js-integration.min.js</jsapurl>
 
 
136
  </general>
137
  </resultadosdigitais>
138
  </default>
2
  <config>
3
  <modules>
4
  <Flowecommerce_Resultadosdigitais>
5
+ <version>0.1.7</version>
6
  </Flowecommerce_Resultadosdigitais>
7
  </modules>
8
  <global>
133
  <resultadosdigitais>
134
  <general>
135
  <jsapurl>https://d335luupugsy2.cloudfront.net/js/integration/stable/rd-js-integration.min.js</jsapurl>
136
+ <jsanalyticsurl>https://d335luupugsy2.cloudfront.net/js/loader-scripts/</jsanalyticsurl>
137
+ <enable_analytics>0</enable_analytics>
138
  </general>
139
  </resultadosdigitais>
140
  </default>
app/code/local/Flowecommerce/Resultadosdigitais/etc/system.xml CHANGED
@@ -48,6 +48,24 @@
48
  <show_in_website>0</show_in_website>
49
  <show_in_store>0</show_in_store>
50
  </private_token>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  </fields>
52
  </general>
53
  </groups>
48
  <show_in_website>0</show_in_website>
49
  <show_in_store>0</show_in_store>
50
  </private_token>
51
+ <enable_analytics>
52
+ <label>Habilitar monitoramento RD?</label>
53
+ <frontend_type>select</frontend_type>
54
+ <source_model>adminhtml/system_config_source_yesno</source_model>
55
+ <sort_order>40</sort_order>
56
+ <show_in_default>1</show_in_default>
57
+ <show_in_website>0</show_in_website>
58
+ <show_in_store>0</show_in_store>
59
+ </enable_analytics>
60
+ <analytics_code translate="label">
61
+ <label>Codigo de monitoramento</label>
62
+ <frontend_type>text</frontend_type>
63
+ <sort_order>50</sort_order>
64
+ <show_in_default>1</show_in_default>
65
+ <show_in_website>0</show_in_website>
66
+ <show_in_store>0</show_in_store>
67
+ <depends><enable_analytics>1</enable_analytics></depends>
68
+ </analytics_code>
69
  </fields>
70
  </general>
71
  </groups>
app/design/frontend/base/default/layout/resultadosdigitais.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <block type="resultadosdigitais/analytics" name="resultadosdigitais.analytics" template="resultadosdigitais/analytics.phtml" />
6
+ </reference>
7
+ </default>
8
+ </layout>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>flowecommerce_resultadosdigitais</name>
4
- <version>0.1.6.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -16,11 +16,13 @@ Uma nova conta de cliente &#xE9; criada&#xD;
16
  Um novo pedido &#xE9; criado&#xD;
17
  Um cliente assina a newsletter da loja virtual&#xD;
18
  Um produto &#xE9; adicionado ao carrinho quando o cliente est&#xE1; logado</description>
19
- <notes>Atualizando vers&#xE3;o no config.xml</notes>
 
 
20
  <authors><author><name>Flow eCommerce</name><user>flowecommerce</user><email>contato@flowecommerce.com</email></author><author><name>Gabriel Queiroz Silva</name><user>gabrielqs</user><email>gabriel@flowecommerce.com</email></author></authors>
21
- <date>2016-03-15</date>
22
- <time>20:40:27</time>
23
- <contents><target name="magelocal"><dir name="Flowecommerce"><dir name="Resultadosdigitais"><dir name="Block"><file name="Apijs.php" hash="c2e7219f6982976799e52f57a8ad7bbf"/><file name="Categoryview.php" hash="1451eca90c6db1c6404da530591db4cc"/><file name="Productview.php" hash="8907353a400c6ca016f93ab0c5ea4599"/></dir><dir name="Helper"><file name="Data.php" hash="09882c5456e06cecd6c185281596af56"/></dir><dir name="Model"><file name="Api.php" hash="ae2f7c8546ff93f7b18facdcb95552cc"/><dir name="Googleanalytics"><file name="Customvar.php" hash="d163ebb5bb590dd7553ed1356c033a2c"/><file name="Tracker.php" hash="be95e10bd1df9ca5319f5a50967f2eed"/><dir name="Utm"><file name="A.php" hash="7604206d87189c56f109231c4a95f00f"/><file name="B.php" hash="e710a66f3c061f4da69e9f468c2eaf5c"/><file name="C.php" hash="27c99ca82b05b11bcba01e88f9a3e5c6"/><file name="V.php" hash="9c77ced8175034ac42b89878e26844f5"/><file name="Z.php" hash="1bb0821f8752993b737a923fcbd4b314"/></dir></dir><file name="Observer.php" hash="ab9ee811fdd4055018f101788eec59b3"/><file name="Requestdata.php" hash="d97634793fae544f18e5ffda617ed745"/></dir><dir name="etc"><file name="adminhtml.xml" hash="be9b06eed9df502e9759b5cd397f9fa2"/><file name="config.xml" hash="c725e6fe7d591019b7caed35e9427e53"/><file name="system.xml" hash="da64ea97bc98fe6f42988df79c2ace1f"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Flowecommerce_Resultadosdigitais.xml" hash="5d476dea8a51bda77126fa637c5f29f2"/></dir></target></contents>
24
  <compatible/>
25
  <dependencies><required><php><min>5.3.0</min><max>5.6.16</max></php></required></dependencies>
26
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>flowecommerce_resultadosdigitais</name>
4
+ <version>0.1.7</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
16
  Um novo pedido &#xE9; criado&#xD;
17
  Um cliente assina a newsletter da loja virtual&#xD;
18
  Um produto &#xE9; adicionado ao carrinho quando o cliente est&#xE1; logado</description>
19
+ <notes>Nova forma para adicionar o c&#xF3;digo de rastreio do RD &#xE0; loja virtual&#xD;
20
+ Enviando c&#xF3;digo da storeview junto com as convers&#xF5;es&#xD;
21
+ Forma diferente de recupera&#xE7;&#xE3;o do e-mail na convers&#xE3;o de nova venda, a forma antiga n&#xE3;o funcionava em algumas instala&#xE7;&#xF5;es.</notes>
22
  <authors><author><name>Flow eCommerce</name><user>flowecommerce</user><email>contato@flowecommerce.com</email></author><author><name>Gabriel Queiroz Silva</name><user>gabrielqs</user><email>gabriel@flowecommerce.com</email></author></authors>
23
+ <date>2016-06-21</date>
24
+ <time>21:08:05</time>
25
+ <contents><target name="magelocal"><dir name="Flowecommerce"><dir name="Resultadosdigitais"><dir name="Block"><file name="Analytics.php" hash="d0fd4fb22e586ed3ece5138aacdd9b41"/><file name="Apijs.php" hash="c4dd321badb4adffcd06932f608052f9"/><file name="Categoryview.php" hash="1451eca90c6db1c6404da530591db4cc"/><file name="Productview.php" hash="8907353a400c6ca016f93ab0c5ea4599"/></dir><dir name="Helper"><file name="Data.php" hash="0cb21a44e5e63eba93b06eb8662aac6f"/></dir><dir name="Model"><file name="Api.php" hash="a118e5a2e9d7cd187f7023ff470657dd"/><dir name="Googleanalytics"><file name="Customvar.php" hash="d163ebb5bb590dd7553ed1356c033a2c"/><file name="Tracker.php" hash="be95e10bd1df9ca5319f5a50967f2eed"/><dir name="Utm"><file name="A.php" hash="7604206d87189c56f109231c4a95f00f"/><file name="B.php" hash="e710a66f3c061f4da69e9f468c2eaf5c"/><file name="C.php" hash="27c99ca82b05b11bcba01e88f9a3e5c6"/><file name="V.php" hash="9c77ced8175034ac42b89878e26844f5"/><file name="Z.php" hash="1bb0821f8752993b737a923fcbd4b314"/></dir></dir><file name="Observer.php" hash="1d3dccb1ac2d6aa50bdf64782a9852dd"/><file name="Requestdata.php" hash="d97634793fae544f18e5ffda617ed745"/></dir><dir name="etc"><file name="adminhtml.xml" hash="be9b06eed9df502e9759b5cd397f9fa2"/><file name="config.xml" hash="1305c68224a126dbc8c8e76a84954f62"/><file name="system.xml" hash="cef156839fcf94d68ff7875ac18cc708"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Flowecommerce_Resultadosdigitais.xml" hash="5d476dea8a51bda77126fa637c5f29f2"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="resultadosdigitais.xml" hash="b02aeff2e74c0743af145748b0d9caac"/></dir></dir></dir></dir></target></contents>
26
  <compatible/>
27
  <dependencies><required><php><min>5.3.0</min><max>5.6.16</max></php></required></dependencies>
28
  </package>