I was cruising around on the cool snippets and code additions/features Bright Themes lists on their website within the blog area and I came across this option to have the membership options popup after a visitor scrolls a percentage you choose through the content.
This was perfect for most people as you can have the button to sign up but many people avoid clicking them and never see the options to sign up. Having a popup after a 25+% scroll through content you increase the odds of having someone sign up to support you.
The issue I saw when implementing is that their default setup triggers on all pages, including the homepage. Personally I don't want the homepage to pop it up because they aren't engaging in content so they don't know the value they would receive yet.
Using If Statement to Stop Firing on Homepage
What I decided to follow was to adapt this if statement I found for locating whether the current page is the homepage:
The linked page basically has the below in a comment:
if (window.location.pathname === "/") {
// Inject or don't based on page location
}