Created
June 22, 2020 19:30
-
-
Save salsalabs/a3283f02bc231f3ae37fb90b8f1dfdd5 to your computer and use it in GitHub Desktop.
Put a wrapper around a script so that it only runs on thank you pages with a donation_KEY and an amount.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Put this text on a new line just after the <script> tag (https://prnt.sc/t4j44d). | |
var isThankYouPage = document.location.href.indexOf("thank_you") != -1; | |
var hasDonationKEY = /donate_page_KEY=\d+/.test(document.location.href); | |
var hasAmount = /amount=\d+/.test(document.location.href); | |
if (isThankYouPage && hasDonationKey && hasAmount) { | |
// Put this text just before the </script> tag (https://prnt.sc/t4j4il). | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment