2022-08-08 18:50:27 +00:00
|
|
|
import useConfig from 'hooks/useConfig';
|
2022-12-27 00:57:59 +00:00
|
|
|
import { useRef } from 'react';
|
|
|
|
|
import { Form, FormRow, TextArea } from 'react-basics';
|
2020-08-08 03:36:57 +00:00
|
|
|
|
2022-12-27 00:57:59 +00:00
|
|
|
export default function TrackingCodeForm({ websiteId }) {
|
|
|
|
|
const ref = useRef(null);
|
2022-08-08 18:50:27 +00:00
|
|
|
const { trackerScriptName } = useConfig();
|
2022-12-27 00:57:59 +00:00
|
|
|
const code = `<script async defer src="${trackerScriptName}" data-website-id="${websiteId}"></script>`;
|
2020-08-08 03:36:57 +00:00
|
|
|
|
|
|
|
|
return (
|
2022-12-27 00:57:59 +00:00
|
|
|
<>
|
|
|
|
|
<Form ref={ref}>
|
|
|
|
|
<FormRow>
|
|
|
|
|
<p>
|
|
|
|
|
To track stats for this website, place the following code in the{' '}
|
|
|
|
|
<code><head></code> section of your HTML.
|
|
|
|
|
</p>
|
|
|
|
|
<TextArea rows={4} value={code} readOnly allowCopy />
|
|
|
|
|
</FormRow>
|
|
|
|
|
</Form>
|
|
|
|
|
</>
|
2020-08-08 03:36:57 +00:00
|
|
|
);
|
|
|
|
|
}
|