TruEffect - Version 1.0.0

Version Notes

Initial Release.

Download this release

Release Info

Developer True Action TruEffect
Extension TruEffect
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/TrueAction/TruEffect/Block/Beacon.php ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_TruEffect
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_TruEffect_Block_Beacon extends Mage_Core_Block_Template
9
+ {
10
+ protected $_pageType;
11
+
12
+ /**
13
+ * Whether or not to display the beacon.
14
+ *
15
+ * @return Boolean
16
+ */
17
+ public function isBeaconEnabled()
18
+ {
19
+ $helper = Mage::helper('trueffect');
20
+ $siteId = $helper->getSiteId();
21
+ return $helper->isEnabled() && ! empty($siteId);
22
+ }
23
+
24
+ /**
25
+ * Get the beacon url.
26
+ *
27
+ * @return String
28
+ */
29
+ public function getBeaconUrl()
30
+ {
31
+ $helper = Mage::helper('trueffect');
32
+ $scheme = $this->getRequest()->getScheme();
33
+ $domain = $helper->getBeaconDomain();
34
+ $siteId = urlencode($helper->getSiteId());
35
+ return "${scheme}://${domain}/tg/gsiutt/store${siteId}.js";
36
+ }
37
+
38
+ /**
39
+ * Get the beacon parameters.
40
+ *
41
+ * @return String
42
+ */
43
+ public function getBeaconParams()
44
+ {
45
+ $helper = Mage::helper('trueffect');
46
+ $cookieData = $helper->getCookieData();
47
+ // NOTE: The variable names being passed are a legacy inheritance from TruEffect and do not
48
+ // always clearly reflect the values they are actually intended to carry.
49
+ return json_encode(array(
50
+ 'siteId' => $helper->getSiteId(),
51
+ 'pageType' => $this->getPageId(),
52
+ 'catId' => $this->getCatId(),
53
+ 'prodId' => $this->getProdIds(),
54
+ 'pQty' => $this->getProdQtys(),
55
+ 'orderId' => $this->getOrderIncrementId(),
56
+ 'cartTotal' => $this->getCartTotal(),
57
+ 'ordertotal' => isset($cookieData['lifeOrderAmt']) ? $cookieData['lifeOrderAmt'] : 0,
58
+ 'browserId' => '' // set just to avoid a JS variable reference error
59
+ ));
60
+ }
61
+
62
+ protected function getPageType() {
63
+ if (! $this->_pageType) {
64
+ $request = Mage::app()->getRequest();
65
+ $this->_pageType = $request->getRouteName() . '-' . $request->getControllerName();
66
+ if ($this->_pageType == 'checkout-onepage' || $this->_pageType == 'checkout-multishipping') {
67
+ if ($request->getActionName() == 'success') {
68
+ $this->_pageType = 'checkout-success';
69
+ } else {
70
+ $this->_pageType = 'checkout';
71
+ }
72
+ }
73
+ }
74
+ return $this->_pageType;
75
+ }
76
+
77
+ protected function getPageId() {
78
+ $pageId = $pageType = $this->getPageType();
79
+ if ($pageType == 'cms-page') {
80
+ $pageId .= '-' . Mage::getSingleton('cms/page')->getIdentifier();
81
+ } else if ($pageType == 'catalog-product') {
82
+ $pageId .= '-' . Mage::registry('current_product')->getId();
83
+ } else if ($pageType == 'catalog-category') {
84
+ $pageId .= '-' . Mage::registry('current_category')->getId();
85
+ }
86
+ return $pageId;
87
+ }
88
+
89
+ protected function getCatId() {
90
+ if ($this->getPageType() == 'catalog-category') {
91
+ return Mage::registry('current_category')->getId();
92
+ }
93
+ return '';
94
+ }
95
+
96
+ protected function getProdIds() {
97
+ $pageType = $this->getPageType();
98
+ if ($pageType == 'catalog-product') {
99
+ return Mage::registry('current_product')->getId();
100
+ } else if ($pageType == 'checkout-cart' || $pageType == 'checkout-success') {
101
+ if ($pageType == 'checkout-cart') {
102
+ $order = Mage::getSingleton('checkout/session')->getQuote();
103
+ } else {
104
+ $order = Mage::getSingleton('sales/order')->load($this->getOrderId());
105
+ }
106
+ $items = $order->getAllVisibleItems();
107
+ $itemPIDs = array();
108
+ foreach ($items as $item) {
109
+ $product = Mage::getModel('catalog/product')->load($item->getProductId());
110
+ $productId = $product->getIdBySku($item->getSku());
111
+ $itemPIDs[] = $productId;
112
+ }
113
+ return implode(',', $itemPIDs);
114
+ }
115
+ return '';
116
+ }
117
+
118
+ protected function getProdQtys() {
119
+ $pageType = $this->getPageType();
120
+ if ($pageType == 'checkout-cart' || $pageType == 'checkout-success') {
121
+ if ($pageType == 'checkout-cart') {
122
+ $order = Mage::getSingleton('checkout/session')->getQuote();
123
+ } else {
124
+ $order = Mage::getSingleton('sales/order')->load($this->getOrderId());
125
+ }
126
+ $items = $order->getAllVisibleItems();
127
+ $itemQtys = array();
128
+ foreach ($items as $item) {
129
+ $qty = $item->getQty();
130
+ if (empty($qty)) $qty = $item->getQtyOrdered();
131
+ $itemQtys[] = $qty;
132
+ }
133
+ return implode(',', $itemQtys);
134
+ }
135
+ return '';
136
+ }
137
+
138
+ protected function getOrderId() {
139
+ if ($this->getPageType() == 'checkout-success') {
140
+ return Mage::getSingleton('checkout/session')->getLastOrderId();
141
+ }
142
+ return '';
143
+ }
144
+
145
+ protected function getOrderIncrementId() {
146
+ $order = Mage::getModel('sales/order')->load($this->getOrderId());
147
+ return $order->getIncrementId();
148
+ }
149
+
150
+ protected function getCartTotal() {
151
+ if ($this->getPageType() == 'checkout-success') {
152
+ $order = Mage::getSingleton('sales/order')->load($this->getOrderId());
153
+ return $order->getSubtotal() + $order->getDiscountAmount();
154
+ } else {
155
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
156
+ if ($quote) return $quote->getSubtotalWithDiscount();
157
+ }
158
+ return '';
159
+ }
160
+ }
app/code/community/TrueAction/TruEffect/Helper/Data.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_TruEffect
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_TruEffect_Helper_Data extends Mage_Core_Helper_Abstract
9
+ {
10
+ const TRUEFFECT_CONFIG_ENABLED = 'advertising_marketing/trueffect/enabled';
11
+ const TRUEFFECT_CONFIG_SITE_ID = 'advertising_marketing/trueffect/site_id';
12
+ const TRUEFFECT_CONFIG_COOKIE_DOMAIN = 'advertising_marketing/trueffect/cookie_domain';
13
+ const TRUEFFECT_CONFIG_BEACON_DOMAIN = 'advertising_marketing/trueffect/beacon_domain';
14
+ const TRUEFFECT_COOKIE_NAME = 'tan_te';
15
+ const TRUEFFECT_COOKIE_LIFE = 315360000; // ten years
16
+
17
+ protected $_cookieData;
18
+
19
+ /**
20
+ * Retrieve admin config for if TruEffect is enabled
21
+ *
22
+ * @return bool
23
+ */
24
+ public function isEnabled()
25
+ {
26
+ return Mage::getStoreConfigFlag(self::TRUEFFECT_CONFIG_ENABLED);
27
+ }
28
+
29
+ /**
30
+ * Retrieve admin setting for site id
31
+ *
32
+ * @return string
33
+ */
34
+ public function getSiteId()
35
+ {
36
+ return Mage::getStoreConfig(self::TRUEFFECT_CONFIG_SITE_ID);
37
+ }
38
+
39
+ /**
40
+ * Retrieve the domain name from which to reference the beacon script.
41
+ *
42
+ * @return string
43
+ */
44
+ public function getBeaconDomain()
45
+ {
46
+ return Mage::getStoreConfig(self::TRUEFFECT_CONFIG_BEACON_DOMAIN);
47
+ }
48
+
49
+ /**
50
+ * Retrieve the domain to use for the cookie. If it's not set, we will attempt to strip off
51
+ * the subdomain manually. This will fail, however in the following edge cases:
52
+ * - sites with no subdomain and a two-part TLD (e.g., "foo.co.uk")
53
+ * - sites with more than one level of subdomain (e.g., "foo.bar.baz.com") where the cookie
54
+ * should be visible to the full "baz.com"
55
+ *
56
+ * @return string
57
+ */
58
+ public function getCookieDomain()
59
+ {
60
+ $domain = Mage::getStoreConfig(self::TRUEFFECT_CONFIG_COOKIE_DOMAIN);
61
+ if (! $domain) {
62
+ $domain = parse_url(Mage::getBaseUrl(), PHP_URL_HOST);
63
+ $domain = substr_count($domain, '.') > 1 ? substr($domain, strpos($domain, '.')) : ".$domain";
64
+ }
65
+ return $domain;
66
+ }
67
+
68
+ public function getCookieData()
69
+ {
70
+ if (! $this->_cookieData) {
71
+ $cookieStr = Mage::getSingleton('core/cookie')->get(self::TRUEFFECT_COOKIE_NAME);
72
+ parse_str($cookieStr, $this->_cookieData);
73
+ }
74
+ return $this->_cookieData;
75
+ }
76
+
77
+ public function setCookieData($cookieData)
78
+ {
79
+ $this->_cookieData = $cookieData;
80
+ }
81
+ }
app/code/community/TrueAction/TruEffect/LICENSE.TXT ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GSI COMMERCE
2
+ MAGENTO CONNECT EXTENSIONS
3
+ END USER LICENSE AGREEMENT
4
+ This End User License Agreement ("Agreement") is made as of July 10, 2012 (the "Effective Date") by and between GSI Interactive, Inc. (dba "TrueAction") ("TrueAction"), a Pennsylvania corporation having its principal place of business at 935 1st Avenue, King of Prussia, PA 19406 USA and the Licensee executing this Agreement.
5
+
6
+ WHEREAS, TrueAction along with its affiliates owned or controlled by GSI Commerce, Inc. (each, a "GSI Company") offer various e-commerce and marketing technology and services to its clients, including, among other things, fulfillment and customer call center services, various marketing technology platform services, and account management and marketing agency services (together, the "GSI Services").
7
+
8
+ WHEREAS, TrueAction desires to grant Licensee a limited licensee to use the applicable Magento Connect integration extension (including the associated documentation, the "Extension") in connection with Licensee's purchase and use of the corresponding GSI Services pursuant to an executed services agreement between Licensee and the applicable GSI Company ("Service Agreement").
9
+
10
+ The parties agree as follows:
11
+ TERMS AND CONDITIONS
12
+ 1. License
13
+ 1.1. Subject to Licensee's payment for the applicable GSI Services pursuant to a Service Agreement and Licensee's compliance with other terms and conditions of a Service Agreement and this Agreement, TrueAction hereby grants Licensee a non-transferable, non-assignable, non-sublicensable, worldwide license to use the Extension, solely for internal purposes, in accordance with the Extension's technical documentation and solely during the term of a Service Agreement.
14
+ 1.2. Licensee shall implement reasonable controls to ensure that it does not use the Extension except as permitted hereunder. TrueAction reserves the right to audit Licensee's use of the Extension during normal business hours and with reasonable notice and to include means within the Extension to limit Licensee's use of the Extension to the use permitted hereunder.
15
+ 1.3. TrueAction shall provide the Extension to Licensee, including the associated technical documentation, for use by Licensee in accordance with this Agreement.
16
+ 1.4. TrueAction may modify the terms of this Agreement at any time upon notice to Licensee, which notice shall be deemed given thirty (30) days following the posting of the modified agreement on the applicable Magento website or other website where the Extension is made available. Continued use of the Extension shall be deemed Licensee's consent and agreement with the modified agreement.
17
+
18
+ 2. License Exclusions and Restrictions
19
+ 2.1. Except as expressly authorized herein, Licensee shall not:
20
+ a. use or deploy the Extension in any manner except in connection with its purchase and use of the GSI Services pursuant to a Service Agreement;
21
+ b. reverse engineer, disassemble, decompile or otherwise attempt to derive the source code or functionality of the Extension, except to the extent allowed under any applicable law;
22
+ c. distribute, sublicense, disclose, market, rent, lease, or offer remote computing services, networking, batch processing or transfer of, the Extension to any third party, or permit any person or entity to have access to the Extension by means of a time sharing, remote computing services, networking, batch processing, service bureau or time sharing arrangement;
23
+ d. export the Extension in violation of U.S. Department of Commerce export administration regulations.
24
+ 2.2. No license, right or interest in any TrueAction or any other GSI Company trademark, trade name or service mark is granted hereunder.
25
+
26
+ 3. Fees
27
+ The Extension is made available to Licensee at no additional charge, subject to Licensee's timely payment for the GSI Services and compliance with a Service Agreement and this Agreement.
28
+
29
+ 4. Title and Protection
30
+ 4.1. TrueAction (or its third party providers) retains title to all portions of the Extension and any copies thereof. The Extension contains valuable proprietary information, and Licensee shall not disclose the Extension to anyone other than those of its employees or consultants under written nondisclosure obligations at least as restrictive as those contained in this Agreement, having a need to know for purposes consistent with this Agreement. Licensee shall be responsible for the compliance of such employees or consultants. Licensee shall affix, to each full or partial copy of the Extension made by Licensee, all copyright and proprietary information notices as were affixed to the original. The obligations set forth in this Section shall survive termination of this Agreement.
31
+ 4.2. If the Extension is acquired by or on behalf of a unit or agency of the U.S. Government (the "Government"), the Government agrees that such Product is "commercial computer software" or "commercial computer software documentation" and that, absent a written agreement to the contrary, the Government's rights with respect to such Product are limited by the terms of this Agreement, pursuant to applicable FAR and/or DFARS and successor regulations.
32
+
33
+ 5. Patent and Copyright Indemnity
34
+ For such time as Licensee is receiving Services pursuant to a Service Agreement, TrueAction shall indemnify and defend Licensee against any claims that the Extension infringes any United States patent or copyright; provided that TrueAction is given prompt notice of such claim and is given information, reasonable assistance and sole authority to defend or settle the claim. In the defense or settlement of the claim, TrueAction shall obtain for Licensee the right to continue using the Extension, replace or modify the Extension so that it becomes non-infringing while giving equivalent performance or, if TrueAction determines that such remedies are not reasonably available, remove the infringing portion of the Extension. TrueAction shall have no liability if the alleged infringement is based on (i) a modification of the Extension by anyone other than, or a combination of the Extension with any product or service not provided by, TrueAction; (ii) use of the Extension other than in accordance with the documentation of this Agreement; or (iii) use of the Extension not in connection with the GSI Services. This Section 5 states TrueAction's entire liability and Licensee's exclusive remedy for infringement.
35
+
36
+ 6. Default and Termination
37
+ 6.1. An event of default shall be deemed to occur if: (i) Licensee fails to perform any of its obligations under this Agreement or is otherwise in breach of this Agreement or a Service Agreement.
38
+ 6.2. If an event of default occurs, the non-defaulting party, in addition to any other rights available to it under the law, may terminate this Agreement and all licenses granted hereunder by written notice to the defaulting party. Remedies shall be cumulative and there shall be no obligation to exercise a particular remedy.
39
+ 6.3. This Agreement and all licenses granted herein shall automatically terminate upon the termination or expiration of the applicable Service Agreement.
40
+ 6.4. Within thirty (30) days after termination of this Agreement, Licensee shall certify in writing to TrueAction that Licensee has ceased use of the Extension and that all copies of the Extension in any form, including partial copies, have been destroyed.
41
+
42
+ 7. Warranty
43
+ 7.1. Warranty. TrueAction warrants for a single period of ninety (90) days commencing upon TrueAction's electronic delivery of the Extension to Licensee that the Extension will in all material respects perform the functions described in the specifications contained in the documentation provided with the Extension. TrueAction will use commercially reasonable efforts to undertake to correct any reported and verifiable error, which shall be TrueAction's entire liability and Licensee's exclusive remedy for errors. TrueAction does not warrant that the Extension will meet Licensee's requirements, that the Extension will operate in the combinations which Licensee may select for use, that the operation of the Extension will be uninterrupted or error-free, or that all error conditions will be corrected. EXCEPT AS PROVIDED IN THIS SECTION ALL SOFTWARE PROVIDED HEREUNDER IS PROVIDED "AS IS".
44
+ 7.2. DISCLAIMER . THE EXPRESS WARRANTIES SET FORTH IN THIS SECTION 7 ARE THE ONLY WARRANTIES MADE BY TRUEACTION WITH RESPECT TO THE EXTENSION PROVIDED BY TRUEACTION. TRUEACTION MAKES NO OTHER WARRANTIES, EXPRESS, IMPLIED OR ARISING BY CUSTOM OR TRADE USAGE, AND, SPECIFICALLY, MAKES NO WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE. TRUEACTION'S EXPRESS WARRANTIES SHALL NOT BE ENLARGED, DIMINISHED OR AFFECTED BY, AND NO OBLIGATION OR LIABILITY SHALL ARISE OUT OF, TRUEACTION RENDERING TECHNICAL OR OTHER ADVICE OR SERVICE IN CONNECTION WITH THE EXTENSION.
45
+
46
+ 8. Limitation of Liability
47
+ 8.1. LIABILITY EXCLUSIONS. NOTHING IN THIS AGREEMENT SHALL EXCLUDE OR LIMIT EITHER PARTY'S LIABILITY FOR BREACH OF THE LICENSES OR RELATED RESTRICTIONS CONTAINED HEREIN OR ANY LIABILITY WHICH CANNOT BE EXCLUDED OR LIMITED BY APPLICABLE LAW. SAVE FOR THE FOREGOING, NEITHER PARTY ACCEPTS AND EACH PARTY HEREBY EXCLUDES ANY LIABILITY FOR LOSS OF OR DAMAGE TO TANGIBLE PROPERTY OTHER THAN THAT CAUSED BY ITS NEGLIGENCE AND HEREBY EXCLUDES ANY OTHER LIABILITY FOR NEGLIGENCE ARISING PURSUANT TO THE TERMS OF THIS AGREEMENT. UNDER NO CIRCUMSTANCES WILL EITHER PARTY BE LIABLE FOR: LOSS OF REVENUE; LOSS OF ACTUAL OR ANTICIPATED PROFITS; LOSS OF CONTRACTS; LOSS OF THE USE OF MONEY; LOSS OF ANTICIPATED SAVINGS; LOSS OF BUSINESS; LOSS OF OPPORTUNITY; LOSS OF GOODWILL; LOSS OF REPUTATION; LOSS OF, DAMAGE TO OR CORRUPTION OF DATA; OR CONSEQUENTIAL OR INDIRECT LOSS OR SPECIAL, PUNITIVE, OR INCIDENTAL DAMAGES (INCLUDING, FOR THE AVOIDANCE OF DOUBT, WHERE SUCH LOSS OR DAMAGE IS ALSO OF A CATEGORY OF LOSS OR DAMAGE ALREADY LISTED), WHETHER FORESEEABLE OR UNFORESEEABLE, BASED ON CLAIMS OF LICENSEE, TRUEACTION OR ANY THIRD PARTY ARISING OUT OF ANY BREACH OR FAILURE OF EXPRESS OR IMPLIED WARRANTY CONDITIONS OR OTHER TERM, BREACH OF CONTRACT, MISREPRESENTATION, NEGLIGENCE, OTHER LIABILITY IN TORT, FAILURE OF ANY REMEDY TO ACHIEVE ITS ESSENTIAL PURPOSE, OR OTHERWISE.
48
+
49
+ 8.2. LIABILITY CAP. NOTWITHSTANDING THE FORM (E.G., CONTRACT, TORT, OR OTHERWISE) IN WHICH ANY LEGAL OR EQUITABLE ACTION MAY BE BROUGHT, IN NO EVENT WILL TRUEACTION OR ITS SUPPLIERS BE LIABLE FOR DAMAGES, RESTITUTION OR LOSSES, THAT EXCEED, IN THE AGGREGATE, FOR EACH RESPECTIVE BREACH OR SERIES OF RELATED BREACHES, THE LESSER OF $5,000 OR THE AMOUNT OF FEES PAID BY LICENSEE FOR THE EXTENSION LICENSE IN THE TWELVE (12) MONTH PERIOD PRIOR TO THE DATE ON WHICH THE EVENT GIVING RISE TO SUCH DAMAGES OR LOSSES OCCURRED.
50
+
51
+ 9. Support Services
52
+ No support services are provided under this Agreement. Any support services provided to Licensee will be provided pursuant to a Service Agreement through the applicable GSI Company.
53
+
54
+ 10. Joint Marketing Activities
55
+ The parties agree to undertake the joint marketing activities set forth in Schedule A (Joint Marketing Activities).
56
+
57
+ 11. Notices
58
+ All notices shall be in writing and sent by first class mail or overnight mail (or courier), transmitted by facsimile (if confirmed by such mailing), or email, to the addresses indicated on the first page of this Agreement, or such other address as either party may indicate by at least ten (10) days prior written notice to the other party. Notices to TrueAction shall be sent to the attention of the General Counsel.
59
+
60
+ 12. Assignment
61
+ Licensee may not assign this Agreement without the prior written consent of TrueAction; provided that such consent shall not be required for assignment to a purchaser of all or substantially all of the assets or equity securities of Licensee who undertakes in writing to be bound by all the terms and conditions of this Agreement. Any prohibited assignment shall be null and void.
62
+
63
+ 13. Entire Agreement
64
+ This Agreement is the complete and exclusive agreement between the parties, which supersedes all proposals or prior agreements, oral or written, including any other online (click-through) agreement which Licensee may have accepted in conjunction with the downloading of the Extension, and all other communications between the parties relating to the subject matter hereof. No purchase order, other ordering document or any hand written or typewritten text or email which purports to modify or supplement the printed text hereof or any executed agreement with any GSI Company other than TrueAction shall add to or vary the terms thereof. Except as contained in a writing signed by both parties, all such proposed variations or additions are objected to and shall have no force or effect.
65
+
66
+ 14. General
67
+ This Agreement is made in and shall be governed by the laws of the State of New York, excluding choice of law principles. All proceedings shall be conducted in English. Venue for all proceedings shall be the state and federal courts located in New York, New York, provided that TrueAction may seek injunctive relief in any court of competent jurisdiction. The United Nations Convention for the International Sale of Goods shall not apply. The section headings herein are provided for convenience only and have no substantive effect on the construction of this Agreement. Except for Licensee's license restrictions herein, neither party shall be liable for any failure to perform due to causes beyond its reasonable control. If any provision of this Agreement is held to be unenforceable, this Agreement shall be construed without such provision. The failure by a party to exercise any right hereunder shall not operate as a waiver of such party's right to exercise such right or any other right in the future. This Agreement may be amended only by a written document executed by a duly authorized representative of each of the parties. The parties agree to receive electronic documents and accept electronic signatures (information attached or logically associated with such document and clicked or otherwise adopted with an intent to sign) including in counterparts which shall be valid substitutes for paper-based documents and signatures, and the legal validity of a transaction will not be denied on the ground that it is not in writing.
68
+
69
+ 15. Definitions
70
+ "Updates" means all published revisions and corrections to the printed documentation and corrections and new releases of the Extension which are generally made available to TrueAction's supported customers at no additional cost or for media and handling charges only. Updates shall not include any options or future products which TrueAction sells separately.
71
+
72
+ SCHEDULE A
73
+ TRUEACTION EXTENSION
74
+ JOINT MARKETING ACTIVITIES
75
+ These Joint Marketing Activities are referenced in and incorporated into the End User License Agreement between GSI Interactive, Inc. ("TrueAction") and ("Licensee"), dated July 10, 2012 (the "Agreement").
76
+ 1. Press Releases. Licensee agrees to permit TrueAction to issue a press releases at (i) contract execution announcing the selection of the Extension(s), and (ii) at launch of GSI Services. Licensee will have the right to approve the release in advance, but such approval will not be unreasonably delayed or withheld.
77
+ 2. Use of Licensee Logo. TrueAction shall be permitted to include Licensee's logo on TrueAction's website (including its social media pages) as well as in connection with the Magento Connect website and in printed marketing material.
78
+ 3. Interview. Licensee agrees to designate one of its founders and/or executives to participate in a video and/or written interview to promote the TrueAction Extension.
79
+ 4. Case Study. The parties shall jointly issue a case study based on such use. Licensee's site may be showcased on TrueAction's website.
80
+ 5. Reference. Licensee's employees shall make themselves available to be a reference for the Extension and will provide quotations about how the Extension has contributed to the success of their site or product.
81
+ 6. Other. Additional joint marketing activities may be developed based upon mutual agreement.
app/code/community/TrueAction/TruEffect/Model/Container/Beacon.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_TruEffect
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_TruEffect_Model_Container_Beacon extends Enterprise_PageCache_Model_Container_Abstract
9
+ {
10
+
11
+ protected function _getCacheId()
12
+ {
13
+ return false;
14
+ }
15
+
16
+ }
app/code/community/TrueAction/TruEffect/Model/Observer.php ADDED
@@ -0,0 +1,306 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_TruEffect
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_TruEffect_Model_Observer
9
+ {
10
+ const TRUEFFECT_LIST_MAX = 10;
11
+
12
+ protected $_oldCookieData;
13
+ protected $_newCookieData;
14
+ protected $_now;
15
+ protected $_enabled;
16
+ protected $_sendCookie = true;
17
+
18
+ public function __construct()
19
+ {
20
+ $helper = Mage::helper('trueffect');
21
+
22
+ // Find out if we're turned on or not, and get out if not.
23
+ $this->_enabled = $helper->isEnabled();
24
+ if (! $this->_enabled) return;
25
+
26
+ // Get the old cookie.
27
+ $this->_oldCookieData = $helper->getCookieData();
28
+
29
+ // Merge existing data into the new cookie.
30
+ $this->_newCookieData = $this->_oldCookieData;
31
+
32
+ // Save the current timestamp to be consistent in generating timestamps.
33
+ $this->_now = time();
34
+ }
35
+
36
+ public function onCustomerRegister($observer)
37
+ {
38
+ if (! $this->_enabled) return;
39
+
40
+ // Set the customer's "account created date."
41
+ $this->_newCookieData['acDt'] = $this->_now;
42
+ }
43
+
44
+ public function onEmailSubscribe($observer)
45
+ {
46
+ if (! $this->_enabled) return;
47
+
48
+ // If the user has just subscribed, set the customer's "email subscribed date."
49
+ if ($observer['subscriber']->getStatus() == Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED) {
50
+ $this->_newCookieData['esDt'] = $this->_now;
51
+ // Otherwise, unset it, because the user has shifted into some state other than subscribed.
52
+ } else {
53
+ $this->_newCookieData['esDt'] = '';
54
+ }
55
+ }
56
+
57
+ public function onProductView($observer)
58
+ {
59
+ if (! $this->_enabled) return;
60
+
61
+ // Add current product to list of recently viewed products.
62
+ $this->addItemToList('rvpList', $observer['product']->getId());
63
+ }
64
+
65
+ public function onCategoryView($observer)
66
+ {
67
+ if (! $this->_enabled) return;
68
+
69
+ // Add current category to list of recently viewed categories.
70
+ $this->addItemToList('rvcList', $observer['category']->getId());
71
+ }
72
+
73
+ public function onSearchQuery($observer)
74
+ {
75
+ if (! $this->_enabled) return;
76
+
77
+ // If this is an AJAX auto-complete request, set a flag to skip sending a cookie at all.
78
+ if (Mage::app()->getRequest()->isAjax()) {
79
+ $this->_sendCookie = false;
80
+ // Otherwise, add current query to list of recently searched queries.
81
+ } else {
82
+ $this->addItemToList('sqList', Mage::helper('catalogsearch')->getQueryText());
83
+ }
84
+ }
85
+
86
+ public function onCompareProduct($observer)
87
+ {
88
+ if (! $this->_enabled) return;
89
+
90
+ // Add product to list of recently compared products.
91
+ $this->addItemToList('compList', $observer['product']->getId());
92
+ }
93
+
94
+ public function onEditWishlist($observer)
95
+ {
96
+ if (! $this->_enabled) return;
97
+
98
+ // Set the customer's last wishlist update date.
99
+ $this->_newCookieData['wlDt'] = $this->_now;
100
+
101
+ // Update list of wishlist items.
102
+ if ($observer['event']->getName() == 'wishlist_add_product') {
103
+ $this->addItemToList('wlPids', $observer['product']->getId());
104
+ } else {
105
+ $this->removeItemFromList('wlPids', $observer['item']->getProductId());
106
+ }
107
+ }
108
+
109
+ public function onEditCart($observer)
110
+ {
111
+ if (! $this->_enabled) return;
112
+
113
+ // Update list of cart items.
114
+ $eventName = $observer['event']->getName();
115
+ if ($eventName == 'sales_quote_add_item') {
116
+ $this->addItemToList('cartList', $observer['quote_item']->getProductId());
117
+ } else if ($eventName == 'sales_quote_remove_item') {
118
+ $this->removeItemFromList('cartList', $observer['quote_item']->getProductId());
119
+ }
120
+ }
121
+
122
+ public function onSaveCart($observer)
123
+ {
124
+ if (! $this->_enabled) return;
125
+
126
+ // Set the customer's last cart update date.
127
+ $this->_newCookieData['cartDt'] = $this->_now;
128
+
129
+ // Set the total merchandise value of the customer's cart, minus promotions.
130
+ $this->_newCookieData['cartAmt'] = $observer['cart']->getQuote()->getSubtotalWithDiscount();
131
+ }
132
+
133
+ public function onCheckoutComplete($observer)
134
+ {
135
+ if (! $this->_enabled) return;
136
+
137
+ $order = $observer['order'];
138
+
139
+ // Clear out the cart variables now that the order is complete.
140
+ $this->_newCookieData['cartList'] = '';
141
+ $this->_newCookieData['cartDt'] = '';
142
+ $this->_newCookieData['cartAmt'] = 0;
143
+
144
+ // Set the list of items in the customer's last order to the current order contents.
145
+ $orderItems = $order->getAllVisibleItems();
146
+ $orderPIDs = array();
147
+ foreach ($orderItems as $orderItem) {
148
+ $orderPIDs[] = $orderItem->getProductId();
149
+ }
150
+ $this->setItemsInList('lastOrdPList', $orderPIDs);
151
+
152
+ // Set the customer's last order date to right now.
153
+ $this->_newCookieData['lastOrdDt'] = $this->_now;
154
+
155
+ // Add the shipping method used to the list of customer's shipping methods.
156
+ $shippingMethod = $order->getShippingMethod();
157
+ if ($shippingMethod) $this->addItemToList('shpList', $shippingMethod);
158
+
159
+ // Add the payment method used to the list of customer's payment methods.
160
+ $payment = $order->getPayment();
161
+ if ($payment) {
162
+ $paymentMethod = $payment->getMethod();
163
+ if ($paymentMethod) $this->addItemToList('payList', $paymentMethod);
164
+ }
165
+
166
+ // Update the customer's lifetime order amount.
167
+ $orderTotal = $observer['quote']->getSubtotalWithDiscount();
168
+ if (isset($this->_newCookieData['lifeOrdAmt'])) {
169
+ $this->_newCookieData['lifeOrdAmt'] += $orderTotal;
170
+ } else {
171
+ $this->_newCookieData['lifeOrdAmt'] = $orderTotal;
172
+ }
173
+
174
+ // Update the customer's post code to their last billing post code.
175
+ $postCode = $order->getBillingAddress()->getPostcode();
176
+ if ($postCode) $this->_newCookieData['zip'] = $postCode;
177
+ }
178
+
179
+ public function onSendResponse($observer)
180
+ {
181
+ if (! $this->_enabled || ! $this->_sendCookie) return;
182
+
183
+ $helper = Mage::helper('trueffect');
184
+
185
+ // Generate a browser ID if it's not set.
186
+ if (! isset($this->_oldCookieData['bID'])) {
187
+ $this->_newCookieData['bID'] = uniqid();
188
+ }
189
+
190
+ // If the first visit timestamp isn't set, it means this is the first visit, so set it.
191
+ if (! isset($this->_oldCookieData['fvDt'])) {
192
+ $this->_newCookieData['fvDt'] = $this->_now;
193
+ }
194
+
195
+ // Set the last visit timestamp to right now.
196
+ $this->_newCookieData['lvDt'] = $this->_now;
197
+
198
+ // If the session ID has changed since the cookie was last written, update the session ID
199
+ // and increment the visit count.
200
+ $hasSessionId = isset($this->_oldCookieData['sID']);
201
+ if (! $hasSessionId || $this->_oldCookieData['sID'] != session_id()) {
202
+ $this->_newCookieData['sID'] = session_id();
203
+ $this->_newCookieData['vCount'] = $hasSessionId ? $this->_newCookieData['vCount'] + 1 : 1;
204
+ }
205
+
206
+ // Set the current currency.
207
+ $this->_newCookieData['curr'] = Mage::app()->getStore()->getCurrentCurrencyCode();
208
+
209
+ // Add a placeholder for an external marketing score.
210
+ // (Not currently used, but requested to be included anyway.)
211
+ $this->_newCookieData['mks'] = 0;
212
+
213
+ // Store the new cookie data in the helper so it can be used by the beacon.
214
+ $helper->setCookieData($this->_newCookieData);
215
+
216
+ // Save the cookie to the HTTP response.
217
+ Mage::getSingleton('core/cookie')->set(
218
+ $helper::TRUEFFECT_COOKIE_NAME,
219
+ $this->getCookieString(),
220
+ $helper::TRUEFFECT_COOKIE_LIFE,
221
+ '/',
222
+ $helper->getCookieDomain());
223
+ }
224
+
225
+ /**
226
+ * Add the given $newValue to the beginning of the list of values under $key in the cookie.
227
+ * If the $newValue is already in the list, it will be moved to the beginning unless $allowDup
228
+ * is set to true, in which case it will be left in place and also added to the beginning.
229
+ * The total number of values will be limited to the value of TRUEFFECT_LIST_MAX.
230
+ *
231
+ * @param string $key
232
+ * @param string $newValue
233
+ * @param bool $allowDup
234
+ */
235
+ protected function addItemToList($key, $newValue, $allowDup = false)
236
+ {
237
+ // Replace commas with spaces in the new value.
238
+ $newValue = str_replace(',', ' ', $newValue);
239
+
240
+ // Start with the existing list of values.
241
+ $listValues = isset($this->_newCookieData[$key]) ? explode(',', $this->_newCookieData[$key]) : array();
242
+
243
+ // If duplicates are not allowed and the value is already in the list, remove it.
244
+ if (! $allowDup && false !== ($index = array_search($newValue, $listValues))) {
245
+ unset($listValues[$index]);
246
+ }
247
+
248
+ // Add value to the beginning of the list.
249
+ array_unshift($listValues, $newValue);
250
+
251
+ // Turn array back into a string for the cookie.
252
+ $this->setItemsInList($key, $listValues);
253
+ }
254
+
255
+ /**
256
+ * Remove the given $value from the list of values under $key in the cookie.
257
+ *
258
+ * @param string $key
259
+ * @param string $value
260
+ */
261
+ protected function removeItemFromList($key, $value)
262
+ {
263
+ // Replace commas with spaces in the given value to make sure we match appropriately.
264
+ $value = str_replace(',', ' ', $value);
265
+
266
+ // Start with the existing list of values (and if there is none, exit early since there's
267
+ // nothing to be removed).
268
+ if (isset($this->_newCookieData[$key])) {
269
+ $listValues = explode(',', $this->_newCookieData[$key]);
270
+ } else return;
271
+
272
+ // If the value is in the list, remove it.
273
+ if (false !== ($index = array_search($value, $listValues))) {
274
+ unset($listValues[$index]);
275
+ }
276
+
277
+ // Turn array back into a string for the cookie.
278
+ $this->setItemsInList($key, $listValues);
279
+ }
280
+
281
+ /**
282
+ * Turn the given array of values into a list of values under $key in the cookie.
283
+ * The total number of values will be limited to the value of TRUEFFECT_LIST_MAX.
284
+ *
285
+ * @param string $key
286
+ * @param array $listValues
287
+ */
288
+ protected function setItemsInList($key, $listValues)
289
+ {
290
+ $this->_newCookieData[$key] = implode(',', array_slice(array_filter($listValues), 0, self::TRUEFFECT_LIST_MAX));
291
+ }
292
+
293
+ /**
294
+ * Turn the new cookie values into a pseudo-query-string (strips '=' and '&', but no encoding).
295
+ *
296
+ * @return string
297
+ */
298
+ protected function getCookieString()
299
+ {
300
+ $valuePairs = array();
301
+ foreach ($this->_newCookieData as $key => $value) {
302
+ $valuePairs[] = $key . '=' . str_replace(array('=', '&'), '', $value);
303
+ }
304
+ return implode('&', $valuePairs);
305
+ }
306
+ }
app/code/community/TrueAction/TruEffect/etc/cache.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * @category TrueAction
5
+ * @package TrueAction_TruEffect
6
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
7
+ */
8
+ -->
9
+ <config>
10
+ <placeholders>
11
+ <trueffect_beacon>
12
+ <block>trueffect/beacon</block>
13
+ <placeholder>TRUEFFECT_BEACON</placeholder>
14
+ <container>TrueAction_TruEffect_Model_Container_Beacon</container>
15
+ <cache_lifetime>86400</cache_lifetime>
16
+ </trueffect_beacon>
17
+ </placeholders>
18
+ </config>
app/code/community/TrueAction/TruEffect/etc/config.xml ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * @category TrueAction
5
+ * @package TrueAction_TruEffect
6
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
7
+ */
8
+ -->
9
+ <config>
10
+ <modules>
11
+ <TrueAction_TruEffect>
12
+ <version>1.0.0</version>
13
+ </TrueAction_TruEffect>
14
+ </modules>
15
+ <global>
16
+ <blocks>
17
+ <trueffect>
18
+ <class>TrueAction_TruEffect_Block</class>
19
+ </trueffect>
20
+ </blocks>
21
+ <helpers>
22
+ <trueffect>
23
+ <class>TrueAction_TruEffect_Helper</class>
24
+ </trueffect>
25
+ </helpers>
26
+ </global>
27
+ <frontend>
28
+ <events>
29
+ <customer_register_success>
30
+ <observers>
31
+ <tan_trueffect>
32
+ <type>singleton</type>
33
+ <class>TrueAction_TruEffect_Model_Observer</class>
34
+ <method>onCustomerRegister</method>
35
+ </tan_trueffect>
36
+ </observers>
37
+ </customer_register_success>
38
+ <newsletter_subscriber_save_after>
39
+ <observers>
40
+ <tan_trueffect>
41
+ <type>singleton</type>
42
+ <class>TrueAction_TruEffect_Model_Observer</class>
43
+ <method>onEmailSubscribe</method>
44
+ </tan_trueffect>
45
+ </observers>
46
+ </newsletter_subscriber_save_after>
47
+ <catalog_controller_product_view>
48
+ <observers>
49
+ <tan_trueffect>
50
+ <type>singleton</type>
51
+ <class>TrueAction_TruEffect_Model_Observer</class>
52
+ <method>onProductView</method>
53
+ </tan_trueffect>
54
+ </observers>
55
+ </catalog_controller_product_view>
56
+ <catalog_controller_category_init_after>
57
+ <observers>
58
+ <tan_trueffect>
59
+ <type>singleton</type>
60
+ <class>TrueAction_TruEffect_Model_Observer</class>
61
+ <method>onCategoryView</method>
62
+ </tan_trueffect>
63
+ </observers>
64
+ </catalog_controller_category_init_after>
65
+ <catalogsearch_query_load_after>
66
+ <observers>
67
+ <tan_trueffect>
68
+ <type>singleton</type>
69
+ <class>TrueAction_TruEffect_Model_Observer</class>
70
+ <method>onSearchQuery</method>
71
+ </tan_trueffect>
72
+ </observers>
73
+ </catalogsearch_query_load_after>
74
+ <catalog_product_compare_add_product>
75
+ <observers>
76
+ <tan_trueffect>
77
+ <type>singleton</type>
78
+ <class>TrueAction_TruEffect_Model_Observer</class>
79
+ <method>onCompareProduct</method>
80
+ </tan_trueffect>
81
+ </observers>
82
+ </catalog_product_compare_add_product>
83
+ <wishlist_add_product>
84
+ <observers>
85
+ <tan_trueffect>
86
+ <type>singleton</type>
87
+ <class>TrueAction_TruEffect_Model_Observer</class>
88
+ <method>onEditWishlist</method>
89
+ </tan_trueffect>
90
+ </observers>
91
+ </wishlist_add_product>
92
+ <wishlist_item_delete_before>
93
+ <observers>
94
+ <tan_trueffect>
95
+ <type>singleton</type>
96
+ <class>TrueAction_TruEffect_Model_Observer</class>
97
+ <method>onEditWishlist</method>
98
+ </tan_trueffect>
99
+ </observers>
100
+ </wishlist_item_delete_before>
101
+ <sales_quote_add_item>
102
+ <observers>
103
+ <tan_trueffect>
104
+ <type>singleton</type>
105
+ <class>TrueAction_TruEffect_Model_Observer</class>
106
+ <method>onEditCart</method>
107
+ </tan_trueffect>
108
+ </observers>
109
+ </sales_quote_add_item>
110
+ <sales_quote_remove_item>
111
+ <observers>
112
+ <tan_trueffect>
113
+ <type>singleton</type>
114
+ <class>TrueAction_TruEffect_Model_Observer</class>
115
+ <method>onEditCart</method>
116
+ </tan_trueffect>
117
+ </observers>
118
+ </sales_quote_remove_item>
119
+ <checkout_cart_save_after>
120
+ <observers>
121
+ <tan_trueffect>
122
+ <type>singleton</type>
123
+ <class>TrueAction_TruEffect_Model_Observer</class>
124
+ <method>onSaveCart</method>
125
+ </tan_trueffect>
126
+ </observers>
127
+ </checkout_cart_save_after>
128
+ <checkout_submit_all_after>
129
+ <observers>
130
+ <tan_trueffect>
131
+ <type>singleton</type>
132
+ <class>TrueAction_TruEffect_Model_Observer</class>
133
+ <method>onCheckoutComplete</method>
134
+ </tan_trueffect>
135
+ </observers>
136
+ </checkout_submit_all_after>
137
+ <controller_front_send_response_before>
138
+ <observers>
139
+ <tan_trueffect>
140
+ <type>singleton</type>
141
+ <class>TrueAction_TruEffect_Model_Observer</class>
142
+ <method>onSendResponse</method>
143
+ </tan_trueffect>
144
+ </observers>
145
+ </controller_front_send_response_before>
146
+ </events>
147
+ <layout>
148
+ <updates>
149
+ <trueffect>
150
+ <file>trueffect.xml</file>
151
+ </trueffect>
152
+ </updates>
153
+ </layout>
154
+ </frontend>
155
+ <adminhtml>
156
+ <acl>
157
+ <resources>
158
+ <admin>
159
+ <children>
160
+ <system>
161
+ <children>
162
+ <config>
163
+ <children>
164
+ <advertising_marketing>
165
+ <title><![CDATA[Advertising &amp; Marketing]]></title>
166
+ </advertising_marketing>
167
+ </children>
168
+ </config>
169
+ </children>
170
+ </system>
171
+ </children>
172
+ </admin>
173
+ </resources>
174
+ </acl>
175
+ </adminhtml>
176
+ <default>
177
+ <advertising_marketing>
178
+ <trueffect>
179
+ <beacon_domain>ad.adlegend.com</beacon_domain>
180
+ </trueffect>
181
+ </advertising_marketing>
182
+ </default>
183
+ </config>
app/code/community/TrueAction/TruEffect/etc/system.xml ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * @category TrueAction
5
+ * @package TrueAction_TruEffect
6
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
7
+ */
8
+ -->
9
+ <config>
10
+ <tabs>
11
+ <marketing translate="label" module="trueffect">
12
+ <label>Marketing</label>
13
+ <sort_order>99999</sort_order>
14
+ </marketing>
15
+ </tabs>
16
+ <sections>
17
+ <advertising_marketing>
18
+ <label><![CDATA[Advertising &amp; Marketing]]></label>
19
+ <tab>marketing</tab>
20
+ <frontend_type>text</frontend_type>
21
+ <sort_order>100</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>1</show_in_store>
25
+ <groups>
26
+ <trueffect translate="label">
27
+ <label>TruEffect</label>
28
+ <frontend_type>text</frontend_type>
29
+ <sort_order>1</sort_order>
30
+ <show_in_default>1</show_in_default>
31
+ <show_in_website>1</show_in_website>
32
+ <show_in_store>1</show_in_store>
33
+ <comment><![CDATA[This extension requres you to have an account with TruEffect. If you do not have an account or do not know the account information to enter below, please contact <a href="http://www.trueffect.com/magento" target="_blank">TruEffect</a> for details.]]></comment>
34
+ <fields>
35
+ <enabled translate="label">
36
+ <label>Enable TruEffect</label>
37
+ <frontend_type>select</frontend_type>
38
+ <source_model>adminhtml/system_config_source_yesno</source_model>
39
+ <sort_order>10</sort_order>
40
+ <show_in_default>1</show_in_default>
41
+ <show_in_website>1</show_in_website>
42
+ <show_in_store>1</show_in_store>
43
+ </enabled>
44
+ <site_id translate="label">
45
+ <label>TruEffect Site ID</label>
46
+ <frontend_type>text</frontend_type>
47
+ <sort_order>20</sort_order>
48
+ <show_in_default>1</show_in_default>
49
+ <show_in_website>1</show_in_website>
50
+ <show_in_store>1</show_in_store>
51
+ </site_id>
52
+ <cookie_domain translate="label">
53
+ <label>TruEffect Cookie Domain</label>
54
+ <frontend_type>text</frontend_type>
55
+ <sort_order>30</sort_order>
56
+ <show_in_default>1</show_in_default>
57
+ <show_in_website>1</show_in_website>
58
+ <show_in_store>1</show_in_store>
59
+ </cookie_domain>
60
+ <beacon_domain translate="label">
61
+ <label>TruEffect Beacon Domain</label>
62
+ <frontend_type>text</frontend_type>
63
+ <sort_order>40</sort_order>
64
+ <show_in_default>1</show_in_default>
65
+ <show_in_website>1</show_in_website>
66
+ <show_in_store>1</show_in_store>
67
+ </beacon_domain>
68
+ </fields>
69
+ </trueffect>
70
+ </groups>
71
+ </advertising_marketing>
72
+ </sections>
73
+ </config>
app/design/frontend/base/default/layout/trueffect.xml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category design
5
+ * @package base_default
6
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
7
+ */
8
+ -->
9
+ <layout version="0.1.0">
10
+ <default>
11
+ <reference name="before_body_end">
12
+ <block type="trueffect/beacon" name="trueffect.beacon" template="trueffect/beacon.phtml"/>
13
+ </reference>
14
+ </default>
15
+ </layout>
app/design/frontend/base/default/template/trueffect/beacon.phtml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category design
4
+ * @package base_default
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ * @var $this = TrueAction_TruEffect_Block_Beacon
7
+ */
8
+ ?>
9
+ <?php if ($this->isBeaconEnabled()): ?>
10
+ <script>
11
+ (function(d,s){
12
+ s=d.getElementsByTagName('head')[0].appendChild(d.createElement('script'));
13
+ s.onload=function(){
14
+ <?php
15
+ /*
16
+ * TruEffect expects its data to be in the global namespace (i.e., on the window object), but that
17
+ * is dangerous because it may conflict with other code on the site. In order to get around this,
18
+ * we turn their measure function inside out and "eval" its guts within a "with" block, effectively
19
+ * simulating setting the variables globally.
20
+ */
21
+ ?>
22
+ with(<?php echo $this->getBeaconParams() ?>){
23
+ eval(String(truEffect.measure).replace(/^[^{]+{|}$/g, ''));
24
+ }
25
+ }
26
+ s.src='<?php echo $this->getBeaconUrl() ?>';
27
+ }(document));
28
+ </script>
29
+ <?php endif; ?>
app/etc/modules/TrueAction_TruEffect.xml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category TrueAction
5
+ * @package TruEffect
6
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
7
+ */
8
+ -->
9
+ <config>
10
+ <modules>
11
+ <TrueAction_TruEffect>
12
+ <active>true</active>
13
+ <codePool>community</codePool>
14
+ </TrueAction_TruEffect>
15
+ </modules>
16
+ </config>
package.xml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>TruEffect</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://media.trueaction.com/magento/LICENSE.TXT">GSI Commerce End User License Agreement</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>TruEffect is the leading display ad management solution for retail and eCommerce.</summary>
10
+ <description>&lt;p&gt;The TruEffect ad platform provides turn-key ad management and data management solutions that consistently deliver proven superior results.&lt;/p&gt;&#xD;
11
+ &lt;ul&gt;&#xD;
12
+ &lt;li&gt;Configurable ad platform to support content delivery, precise targeting, and accurate measurement.&lt;/li&gt;&#xD;
13
+ &lt;li&gt;Integrates Audience Data Mobilization (enhanced DMP solution) to improve ad performance, using patented First-Party technologies.&lt;/li&gt;&#xD;
14
+ &lt;li&gt;Optimizes media with advertising targeted to your goals &#x2013; acquisition, retention, retargeting.&lt;/li&gt;&#xD;
15
+ &lt;li&gt;Gives you the ability to dynamically link your site analytics, CRM data, and ad campaign data.&lt;/li&gt;&#xD;
16
+ &lt;li&gt;Utilizes and enhances advertisers&#x2019; own data without the privacy risks associated with other targeting methods.&lt;/li&gt;&#xD;
17
+ &lt;li&gt;Certified by Google, AOL, Yahoo, MSN and all major publishers.&lt;/li&gt;&#xD;
18
+ &lt;li&gt;TruEffect has proven its ability to increase advertising performance and at the same time reduce the cost of performance for clients across all sectors.&lt;/li&gt;&#xD;
19
+ &lt;/ul&gt;</description>
20
+ <notes>Initial Release.</notes>
21
+ <authors><author><name>True Action TruEffect</name><user>trueaction_te</user><email>trueffect@trueaction.com</email></author></authors>
22
+ <date>2012-07-10</date>
23
+ <time>22:52:19</time>
24
+ <contents><target name="magecommunity"><dir name="TrueAction"><dir name="TruEffect"><dir name="Block"><file name="Beacon.php" hash="a5c7be3494083e87730bff4ea4d9a373"/></dir><dir name="Helper"><file name="Data.php" hash="ad85fa436a2f548b6cd30b5249246bbd"/></dir><file name="LICENSE.TXT" hash="90f4fc90c81a1ca036fad0087c9c7dee"/><dir name="Model"><dir name="Container"><file name="Beacon.php" hash="9eda069ce4bc075d90836c57e9d35402"/></dir><file name="Observer.php" hash="2d3bf434e4df64141a1bd30b5b10cc8e"/></dir><dir name="etc"><file name="cache.xml" hash="a8c4511d1ebb84c2e3da4cec268c855c"/><file name="config.xml" hash="b1939050347a509554b459bc11a1fe25"/><file name="system.xml" hash="2bf16351d0adb45b44704d64dfc1a4fa"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="trueffect.xml" hash="ee32bb7a44b9cc5578c6a325aba029c2"/></dir><dir name="template"><dir name="trueffect"><file name="beacon.phtml" hash="76d4cb17ecd8a47a13843e0e6b04d4b4"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="TrueAction_TruEffect.xml" hash="6ba1d4fca25c1905aefe2d51fdd1c90a"/></dir></target></contents>
25
+ <compatible/>
26
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
27
+ </package>