SaturdaysInRome Posted February 3 Share Posted February 3 I'm trying to use Ezoic for my ads, and one of the obstacles I'm running into is adding categories to my blog posts. I have them set up in Squarespace, but Ezoic is looking for them as meta data. Specifically, they are looking for the data is this format: <meta name="category" content="Food"> I would prefer not to manually add this line to every page, so I was wondering if it is possible (and how) to use a JS script to generate this meta data based on the Squarespace category. To add a little more complexity, I use multiple categories, but only one is relevant for this, so I'd also like to be able to add a conditional statement to return only the correct category. I would appreciate it if someone could point me in the right direction. Link to comment
Ziggy Posted February 3 Share Posted February 3 36 minutes ago, SaturdaysInRome said: <meta name="category" content="Food"> Have you added this to the header code injection for the blog posts? Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com 🔌 Ghost Squarespace Plugins (Referral link)📈 SEO Space (Referral link)⬛ SquareWebsites Plugins (Referral link)☕ Did I help? Buy me a coffee? Link to comment
SaturdaysInRome Posted February 3 Author Share Posted February 3 No, the only meta data was automatically added from the the theme. I was hoping to avoid manually adding the code to every page, if possible, so I've been searching for a scripting solution I could add to the header. Link to comment
SaturdaysInRome Posted February 3 Author Share Posted February 3 or am I looking for something that can't exist? Link to comment
Ziggy Posted February 3 Share Posted February 3 In the blog settings, go to Advanced and Post Blog Item Code Injection, then paste that meta tag and it will be on every blog page. Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com 🔌 Ghost Squarespace Plugins (Referral link)📈 SEO Space (Referral link)⬛ SquareWebsites Plugins (Referral link)☕ Did I help? Buy me a coffee? Link to comment
SaturdaysInRome Posted February 3 Author Share Posted February 3 Thanks Ziggy. I appreciate your response, but the challenge I may have poorly articulated is that there are 5 different categories (as of today), so I was hoping for a way to script the insert of the meta data in the header based on the differing category of the post. I defined the category within squarespace, but it doesn't generate metadata automatically. Again, I can believe it isn't possible, but if there is something I should look into further, that would be helpful. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment