Skip to content

Help Center

Attributer not working on single-page websites

Depending on what site builder/theme you are using, sometimes your website won’t actually be a series of different pages.

Instead, it will be what is known as a ‘single page website’, which means technically everything on your site is actually all loaded on one page when the visitor first lands on your site. And then as a visitor moves around the site they don’t actually move from page to page, instead, elements are just shown/hidden to make it look like they do.

This causes an issue with Attributer as it actually populates the hidden fields in your form on initial load, but when the user actually clicks through to a ‘page’ where the form is visible those values get deleted, and Attributer doesn’t rewrite them because it thinks it’s job is already done.

The solution is to place the following bit of code on your site, directly beneath where you added the Attributer code:

<script>
window.history.pushState = new Proxy(window.history.pushState, {
apply: function apply(target, thisArg, argArray) {
window.setTimeout(function () {
document.FlareTrk.repop();
}, 500);
return target.apply(thisArg, argArray);
}
});
</script>

This basically tells Attributer to continue to try to look for and complete form fields even if it thinks it has already done it, which means it will write the data into the hidden fields when the user navigates to a ‘page’ where the form is visible.

This additional code should be placed directly beneath where you added the original Attributer code (as seen below):

Can't find the answer you need? Contact us!

Our team are available to answer any questions you have

Support Images