PHP code example of kiczek / ga-datalayer-cakephp3

1. Go to this page and download the library: Download kiczek/ga-datalayer-cakephp3 library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kiczek / ga-datalayer-cakephp3 example snippets


$this->loadComponent("DataLayer.DataLayer", [
    'cookieKey' => '_dl',
    'eventName' => 'customEventName',
    'blockName' => 'dataLayerEvents'
]);

echo $this->fetch('dataLayerEvents');

$this->DataLayer->addEvent('Users', 'login');