diff --git a/packages/react-components/src/components/moat-tracking.tsx b/packages/react-components/src/components/moat-tracking.tsx new file mode 100644 index 00000000..7398cc3e --- /dev/null +++ b/packages/react-components/src/components/moat-tracking.tsx @@ -0,0 +1,16 @@ +import React from 'react' +import { constructMoatData } from '@giphy/js-util' + +type Props = { bottleData: any } + +export const MoatTracking = ({ bottleData }: Props) => { + const moatCompatibleData = constructMoatData(bottleData as any) + // Constructing the URL with macros replaced by their values + const url = `https://z.moatads.com/giphyjsdisplay626459778035/moatad.js#${Object.entries(moatCompatibleData) + .map(([key, value]) => `${key}=${value}`) + .join('&')}` + const scriptTag = + return scriptTag +} + +export default MoatTracking