Jump to content

Code Injection Footer but just one page

Recommended Posts

Posted

Site URL: https://www.haikuink.com/thank-you-booking-brows

Hi!

I need to add a bit of code to my Purchase Completed page.

The instructions are : "Paste this code just before the closing </body> tag on your purchase completed page."

But when I try code injection for just that page it only allows Header Injection.

I don't want to add this code to every page just this one particular "Thank You" page before the Footer.

  • Replies 1
  • Views 273
  • Created
  • Last Reply
Posted

That instruction may be an effort to get the code to run later in the page load cycle.

Without being able to see the code it's hard to give advice. But one thing you can try is to wrap the code in the following.

window.addEventListener ( 'DOMContentLoaded', ( ) => {

  /* javascript code here */
  
  } );

This code delays code inserted where indicated until later in the page load cycle.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.