Skip to content

Commit

Permalink
Removed legacy moat code and added new tag, new component with script…
Browse files Browse the repository at this point in the history
… tag
  • Loading branch information
nicksantan committed Apr 30, 2024
1 parent 41f363d commit eebcad0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/react-components/src/components/moat-tracking.tsx
Original file line number Diff line number Diff line change
@@ -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 = <script src={url} type="text/javascript"></script>
return scriptTag
}

export default MoatTracking

0 comments on commit eebcad0

Please sign in to comment.