Jump to content

Using Profiles API to check if a site member is logged in

Recommended Posts

Hi all,

I have created trial content that is public (about half of a full article) as a teaser for site visitors. If they like the content, they can sign up and get access to the full articles. However, if someone has purchased a subscription and happens to visit a public page that links to the trial guide, they will be taken there instead of to the full guide that they purchased. 

Of course, they can still get to the full guide by visiting the member area--either by typing in the URL for the member area page or clicking on a link in the member navigation. 

I think this is a little confusing for members, so I'm wondering if I could create a script to query the Profiles API and check if a user is signed in and has purchased a subscription. Then if they clicked on a page that leads to a trial guide, and they are both signed in and have purchased a subscription, they would be redirected to the member area. 

First off, I'm wondering if this is possible and secondly, how I might go about achieving the querying of the Profiles API. Any tips would be much appreciated!

Link to comment
  • Replies 2
  • Views 290
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

1 hour ago, dsmither said:

I have created trial content that is public (about half of a full article) as a teaser for site visitors. If they like the content, they can sign up and get access to the full articles. However, if someone has purchased a subscription and happens to visit a public page that links to the trial guide, they will be taken there instead of to the full guide that they purchased. 

Can you share a link to the page so we can take a look at the issue? 

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

Link to comment

Sure. If someone visits this pillar page: 

https://www.shemmassianconsulting.com/blog/mcat-biology

They can scroll down and click on specific study topics, such as Genetics and Evolution, Cells and Viruses, etc. 

If they click on Genetics and Evolution, for example, they'll be taken to a truncated or trial version of that article. This is the public-facing content. 

https://www.shemmassianconsulting.com/blog/genetics-evolution-mcat

 

The current member area URL of the Genetics and Evolution article is here:

https://www.shemmassianconsulting.com/premium/mcat-content-guides/genetics-evolution-mcat

Of course, if you go there and you're not a member you'll get an access denied screen. 

It seems like if some users are visiting the site using URLs that their browser remembers, they may not realize they're not in a member area and be confronted with a trial guide. I thought a check for membership and a redirect might help with this.

Thanks for your help!

 

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • 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.