Live page: Local Divorce Attorneys in California | Marble Law Firm
What are you trying to accomplish
I want to send a BI event whenever a user enters an a/b test variant on my page.
The event is fired in the BuilderComponent
’s contentLoaded
callback function.
The issue:
The BI event is fired twice instead of just once in production.
It works as expected when run locally.
Tech-stack
NextJs 13.4.5
Reproducible code example
export async function getStaticProps({
params,
}: GetStaticPropsContext<{ practice: string; stateName: string }>) {
// ...
}
export async function getStaticPaths() {
// ...
}
export default function Page({
page,
}: InferGetStaticPropsType<typeof getStaticProps>) {
// ...
return (
<>
<SEO {...seo} />
<BuilderComponent
model='local-page'
content={page}
data={{ ...geoLocation }}
contentLoaded={(_, content) => {
triggerAbTestBiEvent(content);
}}
/>
</>
);
}