Ghost · · 4 min read

Ghost Membership Popup: Enabling CTA Via Scroll Activity

If you would like to easily present a sign up option to people who are actively engaged in the content you can easily apply this to call a membership popup after xx% scroll.

Presenting a Membership Option as visitors reach 35% read and scrolled

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.

Trigger the Ghost Portal popup based on page scroll progress
Learn how to enhance user engagement on your Ghost CMS website by triggering the Ghost Portal popup based on page scroll progress.

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:

Code injection on the home page
I did notice that and I use it on my other pages, but my home page specifically isn’t listed in the pages or posts sections. When I say the homepage I mean the directory root, example.com/. Is there somewhere I can look to inject only into this page?

The linked page basically has the below in a comment:

if (window.location.pathname === "/") {
// Inject or don't based on page location
}

Read next

We Thrive On Visitors Just Like You - Donate Today

He Knows SEO is a membership based site with chosen content published for free. If you can't become a member today if the content helps you resolve an issue please donate below to help us keep growing!