diff --git a/Model/GAClient.php b/Model/GAClient.php index f8079b2..8b0386c 100644 --- a/Model/GAClient.php +++ b/Model/GAClient.php @@ -140,23 +140,11 @@ public function setTrackingData(\Magento\Framework\DataObject $data) */ public function setTransactionData($data) { - $this->getPurchaseEvent() - ->setTransactionId($data->getTransactionId()) - ->setCurrency($data->getCurrency()) - ->setValue($data->getRevenue()) - ->setTax($data->getTax()) - ->setShipping($data->getShipping()); - - $this->getPurchaseEvent()->setParamValue('session_id', $data->getSessionId()); - $this->getPurchaseEvent()->setParamValue('timestamp_micros', $this->getMicroTime()); - - if ($data->getAffiliation()) { - $this->getPurchaseEvent()->setAffiliation($data->getAffiliation()); + foreach ($data->getData() as $key => $param) { + $this->getPurchaseEvent()->setParamValue($key, $param); } - if ($data->getCouponCode()) { - $this->getPurchaseEvent()->setCouponCode($data->getCouponCode()); - } + $this->getPurchaseEvent()->setParamValue('timestamp_micros', $this->getMicroTime()); } /**