Comments (3)
I see the same issue on success page.
adding a float cast to \MagePal_GoogleTagManager_Block_Tm::getOrdersTrackingCode
should fix the error
$transaction = array(
'transactionId' => $order->getIncrementId(),
'transactionAffiliation' => Mage::app()->getStore()->getFrontendName(),
'transactionTotal' => (float)$order->getBaseGrandTotal(),
'transactionTax' => (float)$order->getBaseTaxAmount(),
'transactionShipping' => (float)$order->getBaseShippingAmount(),
'discountCode' => $order->getCouponCode(),
'discountPrice' => $order->getDiscountAmount(),
'transactionProducts' => $product
);
from magento1-google-tag-manager.
Hey @shashidharkumar and @olivierognn , I think that the error can be solved easily using the JSON Constant "JSON_NUMERIC_CHECK".
In /app/code/local/MagePal/GoogleTagManager/etc/Tm.php on line 84 changed from:
$result[] = sprintf("dataLayer.push(%s);", json_encode($transaction));
to:
$result[] = sprintf("dataLayer.push(%s);", json_encode($transaction, JSON_NUMERIC_CHECK));
Solved 100% to me.
Reference: https://www.php.net/manual/en/json.constants.php
from magento1-google-tag-manager.
from magento1-google-tag-manager.
Related Issues (20)
- Composer.json requires v1.0.1
- Documentation for installation? HOT 9
- Feature Request: Support the enhanced ecommerce Data Layer format HOT 7
- DataLayer - PageType HOT 2
- DataLayer empty on checkout success HOT 5
- Broken php5 compatibility in DataLayer.php
- Can this work for Magento 1 Onestepcheckout HOT 1
- How are we handling GDPR here? HOT 3
- Feature request: catalog send products list HOT 2
- feature request: how do we handle a sale?
- What is/was the meaning of addCustomVariable HOT 1
- //$this->addVariable('productPrice', $_product->getPrice()); HOT 1
- Pushing and matching configurable transaction data HOT 1
- New version on the horizon HOT 1
- Script Rendering Incorrectly? HOT 1
- Would you mind adding this module to packagist? HOT 1
- How to install the plugin? HOT 3
- configure event purchase HOT 1
- How to implement the Google Tag Manager container code has changed. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magento1-google-tag-manager.