'use strict'; const { Component, Fragment } = require('inferno'); const { cacheComponent } = require('../util/cache'); class GoogleAnalytics extends Component { render() { const { trackingId } = this.props; const js = `window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', '${trackingId}');`; return ; } } module.exports = cacheComponent(GoogleAnalytics, 'plugin.googleanalytics', props => { if (!props.head || !props.tracking_id) { return null; } return { trackingId: props.tracking_id }; });