Hi! I’m new to ghost. I’ve converted my WordPress site into ghost. But how can I show ads to free members but no ads for paid members?
You can add an inverted if statement to detect non-paid users and add whatever ad scripts you want
{{^if @member.paid}}
{{!-- Free member, or not logged in (not a member) --}}
{{/if}}
Is this not applicable to the Ghost Pro Starter plan?
Can you describe it to me on how to do that. I’m just a beginner.
Hey!
If you are on the Ghost Pro Starter plan and can’t customise theme files, as vikaspotluri123 suggests, then you can grab the embed code of the ad and add it to an HTML card in your free posts.
If the ad provider gives you a javascript file (e.g. because it is required for the ad to work), then you can put it in the footer code injection of the free post.
And just don’t do any of the above in the paid posts, in which you don’t want any ads.
Of course this is very manual and you will have to do it for every free post, but if your Ghost Pro plan doesn’t allow you to edit and upload theme files, then you don’t have any other options.
Hope this helps.
Thank you for all of your suggestions. I really like ghost for its minimalism and an active forum that actually helps.
I have to make up my mind to upgrade to the Ghost Pro Basic plan
Thank you
Hi! Can you explain how to do that? like showing an example thank you
Hi!
Here is the help page for adding cards to posts and pages using the Ghost editor as you create a post (page). Editor cards HTML cards are one of the options you have. The card is inserted by clicking the + button to the left and under the title placeholder - you’ll see as you edit your page. By clicking the +, all the card option appear as a scrollable list. You select your card (html in this case) and then type in or paste in your html.
And here is how to use code injection for the JavaScript for the ad (if they say that’s needed when you contact your ad provider — remember to ask them for the JavaScript!). How to use Code Injection in Ghost
Concerning JavaScript code injection, in Ghost the code for the script should be placed in the footer code injection area for the post (page). And note, I agree you will have to do this for every page you publish for non-paying visitors (free members and non-members).
There are examples on both the pages I’ve provided, although not specifically for how to place an advert. But the principles are the same. I’ve also noticed some useful help for this using a quick Google.
By exploring this a bit yourself, you may also find you learn a decent quantity of generic Ghost skills.
Oh, and welcome to the Ghost Forum!