# add this at the top of the page
plugin.tx_googletagmanagerdatalayer_init = TEXT
plugin.tx_googletagmanagerdatalayer_init.value = <script type="text/javascript">dataLayer = [];</script>

# add this at the bottom of the page after the plugin are called
plugin.tx_googletagmanagerdatalayer = USER
plugin.tx_googletagmanagerdatalayer {
	userFunc      = TYPO3\CMS\Extbase\Core\Bootstrap->run
	vendorName    = Aoe
	extensionName = GoogleTagManager
	pluginName    = Tracking
	controller    = Tracking
	action        = values
	switchableControllerActions {
		Tracking {
			1 = values
		}
	}
	view {
		templateRootPath = {$const.tx_googletagmanager.view.templateRootPath}
		partialRootPath  = {$const.tx_googletagmanager.view.partialRootPath}
		layoutRootPath   = {$const.tx_googletagmanager.view.layoutRootPath}
	}
	settings {
		enable = {$const.tx_googletagmanager.settings.enable}
		tagId = {$const.tx_googletagmanager.settings.tagId}
		dataLayerVersion = {$const.tx_googletagmanager.settings.dataLayerVersion}
	}
}

# add this at the very bottom of the page

plugin.tx_googletagmanager = USER
plugin.tx_googletagmanager {
	userFunc      = TYPO3\CMS\Extbase\Core\Bootstrap->run
	vendorName    = Aoe
	extensionName = GoogleTagManager
	pluginName    = Tracking
	controller    = Tracking
	action        = index
	switchableControllerActions {
		Tracking {
			1 = index
		}
	}
	view {
		templateRootPath = {$const.tx_googletagmanager.view.templateRootPath}
		partialRootPath  = {$const.tx_googletagmanager.view.partialRootPath}
		layoutRootPath   = {$const.tx_googletagmanager.view.layoutRootPath}
	}
	settings {
		enable = {$const.tx_googletagmanager.settings.enable}
		tagId = {$const.tx_googletagmanager.settings.tagId}
		dataLayerVersion = {$const.tx_googletagmanager.settings.dataLayerVersion}
	}
}


