diff --git a/Resources/Private/TypoScript/Prototypes/TrackingCode.ts2 b/Resources/Private/TypoScript/Prototypes/TrackingCode.ts2 index 0b4e1cf..a391bb1 100644 --- a/Resources/Private/TypoScript/Prototypes/TrackingCode.ts2 +++ b/Resources/Private/TypoScript/Prototypes/TrackingCode.ts2 @@ -1,6 +1,13 @@ # A Piwik tracking code object # prototype(Portachtzig.Neos.Piwik:TrackingCode) < prototype(TYPO3.TypoScript:Template) { - @if.inLiveWorkspace = ${node.context.workspaceName == 'live'} templatePath = 'resource://Portachtzig.Neos.Piwik/Private/Templates/Prototypes/TrackingCode.html' + settings = ${Configuration.setting('Portachtzig.Neos.Piwik')} + + // Show tracking code only in live workspace and if all necessary parameters are set + @if { + inLiveWorkspace = ${node.context.workspaceName == 'live'} + hostIsSet = ${settings.host} + idSiteIsSet = ${settings.idSite} + } } \ No newline at end of file diff --git a/Resources/Private/TypoScript/Root.ts2 b/Resources/Private/TypoScript/Root.ts2 index 0e56a9c..1b0c4be 100644 --- a/Resources/Private/TypoScript/Root.ts2 +++ b/Resources/Private/TypoScript/Root.ts2 @@ -4,9 +4,5 @@ prototype(TYPO3.Neos:Page) { piwikTrackingCode = Portachtzig.Neos.Piwik:TrackingCode { # Google suggests to include the tracking code directly after the tag @position = 'end' - settings = ${Configuration.setting('Portachtzig.Neos.Piwik')} - } -} - - +} \ No newline at end of file