Squarespace new Order Status Page and Trustpilot
A question about Trustpilot service reviews for physical products? Since the new Order Status Page has been introduced in Squarespace no automatic Trustpilot invitations are sent. Invitations were sent when the code 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.
It's necessary to click 'I've migrated the code' to tell Squarespace that you've moved the code from the old to the new page.
The code I've 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.
Incredibly grateful if anyone can offer advice.
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: 'Toni Trustpilot',
referenceId: '{orderId}',
source: 'InvitationScript',
};
tp("createInvitation", trustpilot_invitation);
}
if (tp) {
sendTpInvitation ();
} else {
document.addEventListener ("DOMContentLoaded", function () {
});
}
</script>
{.end}
3 comments
Sort by Date VotesJeremy Robinson Trustpilot
Hi Daniel,
You appear to be using our JavaScript integration within SquareSpace's confirmaiton page.
https://support.trustpilot.com/hc/en-us/articles/360022617174-Implement-Trustpilot-s-JavaScript-integration
It's a browser based call, so if the request is firing and unsuccessful - you should inspect both the console and network tabs (Right Click-Inspect) to confirm what the culprit here may be. There should be errors returned if the call failed.
Also, if you log into your Trustpilot dashboard - please confirm if you are seeing any of these records logging:
https://businessapp.b2b.trustpilot.com/invitations/
Finally, if you are a paid user - please make sure you have brougt this to your Customer Success Manager's attention so they can support you in more detail.
-Jeremy
Jeremy Robinson Trustpilot
Also, please see this guide specific to SquareSpace:
https://support.trustpilot.com/hc/en-us/community/posts/360010620880-Squarespace-Trustpilot-s-JavaScript-integration-Setup-
Daniel Cullen
Hi Jeremy,
Thank you. Yes I was using JavaScript integration within SquareSpace's confirmation page, and had implemented the code from: https://support.trustpilot.com/hc/en-us/community/posts/360010620880-Squarespace-Trustpilot-s-JavaScript-integration-Setup- Unfortunately this stopped working when Squarespace recently added their 'Order Status Page' in addition to their 'Order Confirmation Page'.
I was checking https://businessapp.b2b.trustpilot.com/invitations/ each time I received a new order to see if any new invitations were pending - they were not. Important to point out here that I supply physical products and if you only supply gift certificates then you aren't affected by the change.
This explains a little about the confirmation and order status pages: https://support.squarespace.com/hc/en-us/articles/205815908-Using-code-injection
I also posed my question on Squarespace's forum and found the answer. And both pieces of Trustpilot's code should be inserted into the new 'Order Status Page'. This now works as intended. I appreciate you might find a slightly more elegant way of writing the script but the info Trustpilot has for Squarespace integration does need updating.
ORDER STATUS PAGE
<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>
{.if firstPageView}
<script>
function sendTpInvitation () {
var trustpilot_invitation = {
recipientEmail: '{customerEmailAddress}',
recipientName: 'Toni Trustpilot',
referenceId: '{orderId}',
source: 'InvitationScript',
};
tp("createInvitation", trustpilot_invitation);
}
if (tp) {
sendTpInvitation ();
} else {
document.addEventListener ("DOMContentLoaded", function () {
});
}
</script>
{.end}