A question about Trustpilot service reviews? Since the new Order Status Page has been introduced on Squarespace I've not been able to send out any automatic Trustpilot invitations. Invitations were sent when script was inserted in the old order confirmation page but as I understand it, this is now for gift certificates etc and the order status page is for physical products which applies to me.
I clicked on 'I've migrated the code' to tell Squarespace that I'd done what was requested.
The script inserted is as follows and I've added
{.if firstPageView}
{.end}
to the order status page to try and ensure the code fires only once and not if customers return to that page in order to check on despatch etc.
Incredibly grateful if you have any help you could offer.
Thank you.
HEADER
<script>
(function(w,d,s,r,n){w.TrustpilotObject=n;w[n]=w[n]||function(){(w[n].q=w[n].q||[]).push(arguments)};
a=d.createElement(s);a.async=1;a.src=r;a.type='text/java'+s;f=d.getElementsByTagName(s)[0];
f.parentNode.insertBefore(a,f)})(window,document,'script', 'https://invitejs.trustpilot.com/tp.min.js', 'tp');
tp('register', 'MY KEY HERE');
</script>
ORDER STATUS PAGE
<script>
function sendTpInvitation () {
var trustpilot_invitation = {
recipientEmail: '{customerEmailAddress}',
recipientName: 'Alex',
referenceId: '{orderId}',
source: 'InvitationScript',
};
tp("createInvitation", trustpilot_invitation);
}
if (tp) {
sendTpInvitation ();
} else {
document.addEventListener ("DOMContentLoaded", function () {
});
}
</script>
{.end}