prototype(Carbon.Plausible:Component.TrackingCode) < prototype(Neos.Fusion:Component) { enable = ${Configuration.setting('Carbon.Plausible.enable')} doNotTrack = ${q(node).is('[instanceof Carbon.Plausible:Mixin.DoNotTrack]') && q(node).property('plausibleDoNotTrack')} hasCustomEventMixin = ${q(node).is('[instanceof Carbon.Plausible:Mixin.CustomEvent]')} eventName = ${this.hasCustomEventMixin ? q(node).property('plausibleCustomEventName') : null} eventJSON = ${this.eventName ? String.trim(q(node).property('plausibleCustomEventJSON')) : null} defaultSettings = ${Configuration.setting('Carbon.Plausible.default')} siteName = ${site.name} siteSettings = ${Configuration.setting('Carbon.Plausible.sites')} siteSettings.@process.isDefined = ${this.siteName && Type.isArray(value) && Type.isArray(value[this.siteName]) ? value[this.siteName] : this.defaultSettings} domain = ${this.siteSettings.domain || this.defaultSettings.domain} reverseProxy = ${Carbon.Plausible.getBooleanValue(this.defaultSettings, this.siteSettings, 'reverseProxy')} host = ${this.reverseProxy ? null : (this.siteSettings.host || this.defaultSettings.host)} customEvents = ${Carbon.Plausible.getValue(this.defaultSettings, this.siteSettings, 'customEvents')} dataAnalyticsTracking = ${Carbon.Plausible.getBooleanValue(this.defaultSettings, this.siteSettings, 'dataAnalyticsTracking')} hashBasedRouting = ${Carbon.Plausible.getBooleanValue(this.defaultSettings, this.siteSettings, 'hashBasedRouting')} outboundLinks = ${Carbon.Plausible.getBooleanValue(this.defaultSettings, this.siteSettings, 'outboundLinks')} fileDownloads = ${Carbon.Plausible.getValue(this.defaultSettings, this.siteSettings, 'fileDownloads')} taggedEvents = ${Carbon.Plausible.getBooleanValue(this.defaultSettings, this.siteSettings, 'taggedEvents')} revenue = ${Carbon.Plausible.getBooleanValue(this.defaultSettings, this.siteSettings, 'revenue')} exclusions = ${Carbon.Plausible.getValue(this.defaultSettings, this.siteSettings, 'exclusions')} compat = ${Carbon.Plausible.getValue(this.defaultSettings, this.siteSettings, 'compat')} local = ${Carbon.Plausible.getValue(this.defaultSettings, this.siteSettings, 'local')} pageviewProps = ${Carbon.Plausible.getValue(this.defaultSettings, this.siteSettings, 'pageviewProps')} manual = ${this.siteSettings.manual || Type.isBoolean(this.siteSettings.manual) ? this.siteSettings.manual : this.defaultSettings.manual} customEvents = ${this.siteSettings.customEvents || Type.isBoolean(this.siteSettings.customEvents) ? this.siteSettings.customEvents : this.defaultSettings.customEvents} dataAnalyticsTracking = ${this.siteSettings.dataAnalyticsTracking || this.defaultSettings.dataAnalyticsTracking} async = false defer = true checkIfDomainIsTheSameAsRequest = true renderPlausibleScriptTag = ${this.enable && !this.doNotTrack && this.domain && !node.context.inBackend && (this.checkIfDomainIsTheSameAsRequest ? Carbon.Plausible.checkDomain(request.httpRequest, this.domain) : true)} renderInlineScriptTag = ${this.renderPlausibleScriptTag} @if.renderTags = ${this.renderPlausibleScriptTag || this.renderInlineScriptTag} renderer = Neos.Fusion:Component { @apply.props = ${props} fileTypes = ${Type.isString(props.fileDownloads) ? props.fileDownloads : Array.join(props.fileDownloads, ',')} fileTypes.@if { exclusionIsSet = ${props.fileDownloads} isStringOrArray = ${Type.isString(props.fileDownloads) || Carbon.Array.length(props.fileDownloads)} } dataExclude = ${Type.isString(props.exclusions) ? props.exclusions : Array.join(props.exclusions, ',')} dataExclude.@if { exclusionIsSet = ${props.exclusions} isStringOrArray = ${Type.isString(props.exclusions) || Carbon.Array.length(props.exclusions)} } inlineJavascript = Neos.Fusion:DataStructure { plausibleVariable = 'window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }' eventFromNode = ${'plausible("' + props.eventName + '"' + (props.eventJSON ? ',' + props.eventJSON : '') + ')'} eventFromNode.@if.hasEventName = ${props.eventName} customEvents = ${Type.isString(props.customEvents) ? props.customEvents : null} @if.set = ${props.renderInlineScriptTag && (props.customEvents || props.eventName || props.dataAnalyticsTracking)} @process.filter = ${Array.join(Array.filter(value, line => !!line), ';')} } plausibleSrc = Carbon.Plausible:Component.Src { @apply.props = ${props} } dataAnalyticsTrackingSrc = Neos.Fusion:ResourceUri { @if.set = ${props.renderInlineScriptTag && props.dataAnalyticsTracking} path = 'resource://Carbon.Plausible/Public/Data.js' } renderer = afx` ` } }