Version Notes
- Initial release that allows simple Integration with Yieldify into Magento using only a unique Yieldify ID.
Download this release
Release Info
Developer | Yieldify |
Extension | Yieldify_Integration |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/community/Yieldify/Integration/Helper/Data.php +87 -0
- app/code/community/Yieldify/Integration/controllers/Adminhtml/YieldifyuuidController.php +29 -0
- app/code/community/Yieldify/Integration/etc/adminhtml.xml +34 -0
- app/code/community/Yieldify/Integration/etc/config.xml +52 -0
- app/design/adminhtml/default/default/layout/yieldifyuuid.xml +8 -0
- app/design/adminhtml/default/default/template/yieldify_integration/backend.phtml +35 -0
- app/design/frontend/base/default/layout/yieldify_integration.xml +8 -0
- app/design/frontend/base/default/template/yieldify_integration/frontend.phtml +20 -0
- app/etc/modules/Yieldify_Integration.xml +9 -0
- package.xml +51 -0
app/code/community/Yieldify/Integration/Helper/Data.php
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Yieldify_Integration_Helper_Data extends Mage_Core_Helper_Abstract {
|
3 |
+
const VARIABLE_NAME = 'yieldify_uuid';
|
4 |
+
const ENVIRONMENT = 'YIELDIFY_ENV';
|
5 |
+
protected static $DOMAIN_LIST = array( // due to PHP5.5 not allowing arrays to be constant variables
|
6 |
+
'production' => 'app.yieldify.com',
|
7 |
+
);
|
8 |
+
|
9 |
+
private $currentVersion;
|
10 |
+
private $majorVersion;
|
11 |
+
private $minorVersion;
|
12 |
+
private $valueName;
|
13 |
+
|
14 |
+
public function __construct() {
|
15 |
+
$this->currentVersion = explode('.',Mage::getVersion());
|
16 |
+
$this->majorVersion = intval($this->currentVersion[0]);
|
17 |
+
$this->minorVersion = intval($this->currentVersion[1]);
|
18 |
+
$this->valueName = ($this->majorVersion==1 && $this->minorVersion>=6)? 'plain' : 'text';
|
19 |
+
}
|
20 |
+
|
21 |
+
public function getVariable() {
|
22 |
+
$this->_tryCreateVariable();
|
23 |
+
$tmp = $this->_getVariable();
|
24 |
+
if(!is_null($tmp) && $tmp!=='')
|
25 |
+
return $tmp;
|
26 |
+
else
|
27 |
+
return '';
|
28 |
+
}
|
29 |
+
|
30 |
+
public function setVariable($uuid) {
|
31 |
+
$this->_tryCreateVariable();
|
32 |
+
return $this->_setVariable($uuid);
|
33 |
+
}
|
34 |
+
|
35 |
+
public function getDomain() {
|
36 |
+
$env_var = getenv(self::ENVIRONMENT);
|
37 |
+
$keys = array_keys(self::$DOMAIN_LIST);
|
38 |
+
|
39 |
+
if(count($keys)===1 || $env_var===false) {
|
40 |
+
return self::$DOMAIN_LIST[$keys[0]];
|
41 |
+
}
|
42 |
+
|
43 |
+
$env_var = strtolower($env_var);
|
44 |
+
foreach($keys as $key) {
|
45 |
+
if(strpos($key, $env_var)===0)
|
46 |
+
return self::$DOMAIN_LIST[$key];
|
47 |
+
}
|
48 |
+
|
49 |
+
return self::$DOMAIN_LIST[$keys[0]];
|
50 |
+
}
|
51 |
+
|
52 |
+
private function _tryCreateVariable() {
|
53 |
+
$tmp = $this->_getVariable();
|
54 |
+
if(!is_null($tmp) && $tmp!=='')
|
55 |
+
return false;
|
56 |
+
try {
|
57 |
+
$this->_createVariable();
|
58 |
+
return true;
|
59 |
+
}
|
60 |
+
catch (Exception $e) {
|
61 |
+
return false;
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
private function _getVariable() {
|
66 |
+
return Mage::getModel('core/variable')
|
67 |
+
->loadByCode(self::VARIABLE_NAME)
|
68 |
+
->getValue($this->valueName);
|
69 |
+
}
|
70 |
+
|
71 |
+
private function _setVariable($uuid) {
|
72 |
+
return Mage::getModel('core/variable')
|
73 |
+
->loadByCode(self::VARIABLE_NAME)
|
74 |
+
->setHtmlValue($uuid)
|
75 |
+
->setPlainValue($uuid)
|
76 |
+
->save();
|
77 |
+
}
|
78 |
+
|
79 |
+
private function _createVariable() {
|
80 |
+
return Mage::getModel('core/variable')
|
81 |
+
->setCode(self::VARIABLE_NAME)
|
82 |
+
->setName(self::VARIABLE_NAME)
|
83 |
+
->setHtmlValue('')
|
84 |
+
->setPlainValue('')
|
85 |
+
->save();
|
86 |
+
}
|
87 |
+
}
|
app/code/community/Yieldify/Integration/controllers/Adminhtml/YieldifyuuidController.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Yieldify_Integration_Adminhtml_YieldifyuuidController extends Mage_Adminhtml_Controller_Action {
|
4 |
+
|
5 |
+
private $variablesHelper;
|
6 |
+
|
7 |
+
public function __construct(
|
8 |
+
Zend_Controller_Request_Abstract $request,
|
9 |
+
Zend_Controller_Response_Abstract $response,
|
10 |
+
array $invokeArgs = array()) {
|
11 |
+
|
12 |
+
$this->variablesHelper = Mage::helper('yieldify_helper');
|
13 |
+
parent::__construct($request, $response, $invokeArgs);
|
14 |
+
}
|
15 |
+
|
16 |
+
public function indexAction() {
|
17 |
+
$this->loadLayout()
|
18 |
+
->_setActiveMenu('yieldifytab')
|
19 |
+
->_title($this->__('Yieldify - Set Yieldify ID'));
|
20 |
+
|
21 |
+
$new_uuid = $this->getRequest()->getParam('new_uuid');
|
22 |
+
if(!is_null($new_uuid)) {
|
23 |
+
$this->variablesHelper->setVariable($new_uuid);
|
24 |
+
$this->_redirect('*/*/index');
|
25 |
+
}
|
26 |
+
|
27 |
+
$this->renderLayout();
|
28 |
+
}
|
29 |
+
}
|
app/code/community/Yieldify/Integration/etc/adminhtml.xml
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<menu>
|
4 |
+
<yieldifytab translate="title" module="default_helper">
|
5 |
+
<title>Yieldify</title>
|
6 |
+
<sort_order>85</sort_order>
|
7 |
+
<children>
|
8 |
+
<index translate="title" module="default_helper">
|
9 |
+
<title>Set Yieldify ID</title>
|
10 |
+
<sort_order>1</sort_order>
|
11 |
+
<action>adminhtml/yieldifyuuid/index</action>
|
12 |
+
</index>
|
13 |
+
</children>
|
14 |
+
</yieldifytab>
|
15 |
+
</menu>
|
16 |
+
<acl>
|
17 |
+
<resources>
|
18 |
+
<admin>
|
19 |
+
<children>
|
20 |
+
<yieldifytab translate="title" module="default_helper">
|
21 |
+
<title>Yieldify</title>
|
22 |
+
<sort_order>85</sort_order>
|
23 |
+
<children>
|
24 |
+
<index translate="title" module="default_helper">
|
25 |
+
<title>Set Yieldify ID</title>
|
26 |
+
<sort_order>1</sort_order>
|
27 |
+
</index>
|
28 |
+
</children>
|
29 |
+
</yieldifytab>
|
30 |
+
</children>
|
31 |
+
</admin>
|
32 |
+
</resources>
|
33 |
+
</acl>
|
34 |
+
</config>
|
app/code/community/Yieldify/Integration/etc/config.xml
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<!-- Basic module configuration -->
|
4 |
+
<modules>
|
5 |
+
<Yieldify_Integration>
|
6 |
+
<version>1.0.0</version>
|
7 |
+
</Yieldify_Integration>
|
8 |
+
</modules>
|
9 |
+
<!-- Add layout file to the frontend -->
|
10 |
+
<frontend>
|
11 |
+
<layout>
|
12 |
+
<updates>
|
13 |
+
<yieldify_integration>
|
14 |
+
<file>yieldify_integration.xml</file>
|
15 |
+
</yieldify_integration>
|
16 |
+
</updates>
|
17 |
+
</layout>
|
18 |
+
</frontend>
|
19 |
+
<!-- Add the default controller so the admin menu doesn't break -->
|
20 |
+
<global>
|
21 |
+
<helpers>
|
22 |
+
<default_helper> <!-- name used for the model of the yieldifytab on adminhtml.xml -->
|
23 |
+
<class>Mage_Core_Helper</class> <!-- Helper definition needed by Magento -->
|
24 |
+
</default_helper>
|
25 |
+
<yieldify_helper>
|
26 |
+
<class>Yieldify_Integration_Helper</class>
|
27 |
+
</yieldify_helper>
|
28 |
+
</helpers>
|
29 |
+
</global>
|
30 |
+
<!-- Add new routes to the admin -->
|
31 |
+
<admin>
|
32 |
+
<routers>
|
33 |
+
<adminhtml>
|
34 |
+
<args>
|
35 |
+
<modules>
|
36 |
+
<Yieldify_Integration before="Mage_Adminhtml">Yieldify_Integration_Adminhtml</Yieldify_Integration>
|
37 |
+
</modules>
|
38 |
+
</args>
|
39 |
+
</adminhtml>
|
40 |
+
</routers>
|
41 |
+
</admin>
|
42 |
+
<!-- Add layout file to the backend -->
|
43 |
+
<adminhtml>
|
44 |
+
<layout>
|
45 |
+
<updates>
|
46 |
+
<yieldify_integration>
|
47 |
+
<file>yieldifyuuid.xml</file>
|
48 |
+
</yieldify_integration>
|
49 |
+
</updates>
|
50 |
+
</layout>
|
51 |
+
</adminhtml>
|
52 |
+
</config>
|
app/design/adminhtml/default/default/layout/yieldifyuuid.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout>
|
3 |
+
<adminhtml_yieldifyuuid_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="core/template" name="templateBlock" template="yieldify_integration/backend.phtml"></block>
|
6 |
+
</reference>
|
7 |
+
</adminhtml_yieldifyuuid_index>
|
8 |
+
</layout>
|
app/design/adminhtml/default/default/template/yieldify_integration/backend.phtml
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$helper = Mage::helper('yieldify_helper');
|
4 |
+
$yieldify_uuid = $helper->getVariable();
|
5 |
+
?>
|
6 |
+
<div class="content-header"><table cellspacing="0"><tbody><tr><td>
|
7 |
+
<h3>Yieldify</h3>
|
8 |
+
</td></tr></tbody></table></div>
|
9 |
+
|
10 |
+
<script>
|
11 |
+
function _yieldify_redirect_set_uuid() {
|
12 |
+
document.getElementById('_yieldify_uuid_submit').disabled = true;
|
13 |
+
document.getElementById('_yieldify_uuid_submit').value = 'Saving';
|
14 |
+
var element_value = document.getElementById('_yieldify_uuid_input').value;
|
15 |
+
var url_str = window.location.href;
|
16 |
+
if(url_str.slice(-1)!=='/') {
|
17 |
+
url_str += '/';
|
18 |
+
}
|
19 |
+
var url_arr = url_str.split('/');
|
20 |
+
var i = 0;
|
21 |
+
for(i=0; i<url_arr.length; i++) {
|
22 |
+
if(url_arr[i]==='yieldifyuuid')
|
23 |
+
break;
|
24 |
+
}
|
25 |
+
if(url_arr[i+1]!=='index') {
|
26 |
+
url_arr.splice(i+1, 0, 'index');
|
27 |
+
}
|
28 |
+
window.location = url_arr.join('/') + 'new_uuid/' + element_value;
|
29 |
+
}
|
30 |
+
</script>
|
31 |
+
<div class="content-body">
|
32 |
+
<label>Please insert the unique Yieldify ID you were provided during account set-up:</label>
|
33 |
+
<input id="_yieldify_uuid_input" type="text" value="<?php echo $yieldify_uuid; ?>" style="width: 250px;"/>
|
34 |
+
<input id="_yieldify_uuid_submit" type="submit" value="Save" onclick="javascript:_yieldify_redirect_set_uuid();" style="width: 60px;"></input>
|
35 |
+
</div>
|
app/design/frontend/base/default/layout/yieldify_integration.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout>
|
3 |
+
<default>
|
4 |
+
<reference name="head">
|
5 |
+
<block type="core/template" template="yieldify_integration/frontend.phtml" />
|
6 |
+
</reference>
|
7 |
+
</default>
|
8 |
+
</layout>
|
app/design/frontend/base/default/template/yieldify_integration/frontend.phtml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
|
5 |
+
$helper = Mage::helper('yieldify_helper');
|
6 |
+
|
7 |
+
|
8 |
+
$yieldify_uuid = $helper->getVariable();
|
9 |
+
$environment = $helper->getDomain();
|
10 |
+
?>
|
11 |
+
<?php if(!is_null($yieldify_uuid) && $yieldify_uuid!=='') { ?>
|
12 |
+
<script>
|
13 |
+
(function(d) {
|
14 |
+
var e = d.createElement('script');
|
15 |
+
e.src = d.location.protocol + '//<?php echo $environment; ?>/yieldify/code.js?w_uuid=<?php echo $yieldify_uuid; ?>&loca=' + window.location.href;
|
16 |
+
e.async = true;
|
17 |
+
d.getElementsByTagName('head')[0].appendChild(e);
|
18 |
+
}(document));
|
19 |
+
</script>
|
20 |
+
<?php } ?>
|
app/etc/modules/Yieldify_Integration.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Yieldify_Integration>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Yieldify_Integration>
|
8 |
+
</modules>
|
9 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Yieldify_Integration</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Yieldify Integration for smart and simple onsite and email remarketing for your Magento store.</summary>
|
10 |
+
<description>Conversions. Smart and simple.
|
11 |
+
Yieldify’s smart and simple onsite and email remarketing products predict customer behaviour to optimize customer experience with brand revenue. It’s the easy way to increase conversions, drive value and generate leads, trusted by over 500 brands worldwide on more than 1,000 websites.
|
12 |
+
Our Magento extension now allows you to integrate our Tag in minutes, with no IT support needed. If you’re new to Yieldify, click here [link to landing page] to get in touch with us to set up your account.
|
13 |
+
With our Tag integrated, our fully-managed service then makes sure that you get the best value out of our technology - from identifying your conversion opportunities to designing, testing and evaluating your campaigns. Our performance-based pricing means that
|
14 |
+
Key products and features
|
15 |
+
Onsite remarketing: ‘stay and convert’
|
16 |
+
Drive conversions, value and leads by predicting and adapting to your visitors’ onsite behaviour
|
17 |
+
Create engaging experiences across smartphone, tablet and desktop with our wide variety of overlays
|
18 |
+
Capture attention with dynamic and engaging content - from kaleidoscope designs to countdown clocks, drive the right action with personalised content
|
19 |
+
Get maximum results with our smart segmentation, reaching the right users to deliver your goals
|
20 |
+
Engage at precisely the right time using our range of triggering options; maximise your website’s many opportunities to engage beyond just exit intent
|
21 |
+
Be confident in your campaigns by A/B testing your overlays
|
22 |
+
Email remarketing: ‘return and convert’
|
23 |
+
Drive conversions, value and leads even after your customer has left your website, with targeted emails
|
24 |
+
Encourage users to return and make a purchase with cart abandonment emails
|
25 |
+
A personalised user experience that continues after they’ve left the site
|
26 |
+
Richer customer data when you combine with onsite remarketing
|
27 |
+
Services
|
28 |
+
Our fully-managed service makes every step of the journey smart and simple:
|
29 |
+
Performance-based pricing means that you only pay when our campaigns earn you revenue
|
30 |
+
Multi-channel personalisation; optimise your campaigns across smartphone, tablet and desktop
|
31 |
+
Granular analytics; access to our Dashboard shows you information in real-time
|
32 |
+
24/7 support from our five offices around the world - in twelve languages and counting
|
33 |
+
Strategic counsel; we identify the opportunities to drive value and conversions on your website so you can make the best of using Yieldify
|
34 |
+
An end-to-end service; from strategy, to set-up, to QA testing and reporting, we manage the whole Yieldify experience for you - including design
|
35 |
+
What our clients say
|
36 |
+
“Yieldify’s products and service have proven to be a valuable part of our digital strategy, driving an increase in conversion rates, average order values and high ROI as a result.” - Domino’s Pizza
|
37 |
+
“Great product, great service and great team. We are delighted with Yieldify’s performance across our online touchpoints. Our campaigns were executed quickly and we have seen a measurable increase in conversions and leads generated as a result of their on-site marketing.” - The Fragrance Shop
|
38 |
+
How to get started
|
39 |
+
New customers
|
40 |
+
If you’re new to Yieldify, you’ll need to get in touch with us using this form [link] and one of our team will get back to you to set up your account; we’ll give you the ID number you’ll need to complete the integration
|
41 |
+
Existing customers
|
42 |
+
If you already have an account with us and need help with getting started via Magento, please contact your Account Manager
|
43 |
+
Learn more at yieldify.com</description>
|
44 |
+
<notes>- Initial release that allows simple Integration with Yieldify into Magento using only a unique Yieldify ID.</notes>
|
45 |
+
<authors><author><name>Yieldify</name><user>Yieldify</user><email>magento@yieldify.com</email></author></authors>
|
46 |
+
<date>2016-03-02</date>
|
47 |
+
<time>17:41:24</time>
|
48 |
+
<contents><target name="magecommunity"><dir name="Yieldify"><dir name="Integration"><dir name="Helper"><file name="Data.php" hash="c9fe5ab4ebd5a64f848f926ec3b55e74"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="YieldifyuuidController.php" hash="b7a9cadfdd463ac8c2bd2dc022866735"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="7626b6772262e64b9839f2c83f47af85"/><file name="config.xml" hash="2d95f0b261c399307c8bf5dedfae94fc"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="yieldifyuuid.xml" hash="d9692c9afaea94f7669606b87778a9c8"/></dir><dir name="template"><dir name="yieldify_integration"><file name="backend.phtml" hash="6272fb0a177feec3c726ffaaa018e483"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="yieldify_integration.xml" hash="cae7e1f3cb4ddeb928ee1c91dd6de877"/></dir><dir name="template"><dir name="yieldify_integration"><file name="frontend.phtml" hash="36263d9c745999bf38b9a5f31f971df9"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Yieldify_Integration.xml" hash="6fa40cdb40349504d56529a5d4595b28"/></dir></target></contents>
|
49 |
+
<compatible/>
|
50 |
+
<dependencies><required><php><min>5.3.0</min><max>5.6.99</max></php></required></dependencies>
|
51 |
+
</package>
|