Use the snippet below to ensure every email capture (emailSubmission) that occurs inside your HeavySet Tech form is credited to your Simpli.fi campaign.
1. Prerequisites
✔ You already have a HeavySet Tech form (iframe or widget) embedded on your page.
✔ Simpli.fi has supplied your unique tag URL (e.g. https://tag.simpli.fi/sifitag/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
✔ You can edit the page HTML.
2. Add the script
Copy the snippet below—replace <SIMPLIFI-TAG-URL> with the exact URL provided by Simpli.fi—and paste it directly after your HeavySet Tech embed (ideally just before </body>):
<!-- HeavySet → Simpli.fi emailSubmission listener -->
<script>
/* inject Simpli.fi tag once per emailSubmission */
function loadSimpliFiTag() {
if (window.__simpliFiHSLoaded) return;
window.__simpliFiHSLoaded = true;
const s = document.createElement('script');
s.async = true;
s.src = '<SIMPLIFI-TAG-URL>'; /* provided by Simpli.fi */
document.body.appendChild(s);
}
/* listen for HeavySet Tech postMessage events */
window.addEventListener('message', (event) => {
if (!event.origin.includes('heavyset.tech')) return;
const t = event.data?.type;
if (t === 'emailSubmission') loadSimpliFiTag();
});
</script>
Why this works
-
The HeavySet Tech embed emits a
postMessagewhen a visitor successfully submits an email (event.data.type === "emailSubmission"). -
The listener waits for that message and dynamically injects the Simpli.fi tag, ensuring the tag only fires after consent is gathered and a real submission occurs.
-
The guard
window.__simpliFiHSLoadedprevents duplicate loads if a visitor submits the form multiple times in one session.
3. Test it
-
Publish the page.
-
Submit a test email through your form.
-
In DevTools → Network, filter by your Simpli.fi tag URL and confirm it returns HTTP 200 or 304.
-
If the request is missing, verify that:
-
The Simpli.fi URL is correct.
-
The script sits below the form embed.
-
The browser console shows no JavaScript errors.
-
4. Troubleshooting & Tips
-
"Script already executed" – Make sure you removed any earlier standalone Simpli.fi script tags so the tag only comes through the listener.
-
Multiple submissions – The guard flag prevents duplicates; if you do need multiple fires, remove the
if (window.__simpliFiHSLoaded) return;line. -
Consent frameworks – If you rely on a CMP, the listener fires only after the email submission event, which typically follows user consent. For more granular logic, expand
loadSimpliFiTag()with your CMP checks.
Need help?
If you’re not yet using HeavySet Tech, book a live demo to see how we can streamline your lead capture and attribution.
Comments
0 comments
Please sign in to leave a comment.