/**
  * Set base grand total of order to registry
  *
  * @param \Magento\Framework\Event\Observer $observer
  * @return \Magento\GoogleAdwords\Observer\SetConversionValueObserver
  */
 public function execute(\Magento\Framework\Event\Observer $observer)
 {
     if (!($this->_helper->isGoogleAdwordsActive() && $this->_helper->isDynamicConversionValue())) {
         return $this;
     }
     $orderIds = $observer->getEvent()->getOrderIds();
     if (!$orderIds || !is_array($orderIds)) {
         return $this;
     }
     $this->_collection->addFieldToFilter('entity_id', ['in' => $orderIds]);
     $conversionValue = 0;
     /** @var $order \Magento\Sales\Model\Order */
     foreach ($this->_collection as $order) {
         $conversionValue += $order->getBaseGrandTotal();
     }
     $this->_registry->register(\Magento\GoogleAdwords\Helper\Data::CONVERSION_VALUE_REGISTRY_NAME, $conversionValue);
     return $this;
 }