CVM / Magento_GoogleTagManager

Google Tag Manager extension for Magento
67 stars 55 forks source link

Add an event to enable other modules to add data to the data layer #3

Closed mruoss closed 10 years ago

mruoss commented 11 years ago

Hi Chris

Nice implementation. It would be cool to have an event for other modules to add additional data to the data layer. What do you think?

An observer of this event could add data to the data layer as follows:

    public function addDataLayer($observer) {
        $data_layer = $observer->getDataLayer();
        $data_layer->setData('MyAdditionalData', 'some data');
        return $this;
    }

Cheers, Michael

CVM commented 10 years ago

Apologies this took so long for me to attend to. Very worthwhile addition!