rsnext/examples/with-google-analytics-amp/components/amp/AmpAnalytics.js
Shyam Gupta 506116c7d0
chore: remove-redundant-example-react-import (#13907)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-06-08 21:31:56 -04:00

19 lines
486 B
JavaScript

import AmpIncludeCustomElement from './AmpIncludeCustomElement'
export default function AmpAnalytics(props) {
return (
<>
<AmpIncludeCustomElement name="amp-analytics" version="0.1" />
<amp-analytics type={props.type}>
{props.script && (
<script
type="application/json"
dangerouslySetInnerHTML={{
__html: JSON.stringify(props.script),
}}
/>
)}
</amp-analytics>
</>
)
}