Hello. Looking for help adding a script to a Gatsby site. I'm adding a tracking script for an affiliate program (Refersion). I tried adding it to the gatsby-ssr.js page but it's not working (code below). Anyone have any other ideas for how to add this script? Would appreciate any help.
import React from "react"; export function onRenderBody( { setHeadComponents } ) { setHeadComponents([ <script type="text/javascript" src="subdomain.refersion.com/tracker/v3/pubKEY.js> _refersion(); </script>, ]); }
Muescha
you can checkout how it is done with Google Analytics:
gatsbyjs.org/docs/adding-analytics
github.com/gatsbyjs/gatsby/blob/master/packages/g… github.com/gatsbyjs/gatsby/blob/master/packages/g…