Frameworks (Advanced)
Gatsby
Install VisitorLead using gatsby-ssr's onRenderBody.
In gatsby-ssr.js (create it at the project root if missing):
import React from "react";
export const onRenderBody = ({ setHeadComponents }) => {
setHeadComponents([
<script
key="visitorleadjs"
id="visitorleadjs"
async
src="https://ingest.visitorlead.tech/vl.js"
data-code="YOUR_SITE_CODE"
/>,
]);
};Verify
Run gatsby develop and visit your site. VisitorLead → Sessions should record the session.