Means to add code to head section of a page

Hi guys

My first post here in this subsection of the forum. I’m trying to create a bric in which I need to add code to the head-section of the page. While the custom bric creation documentation is fairly clear on how to create the bric itself, I’m not sure if what I’m trying to achieve will be possible.

Currently I’m looking to create a bric for the store to add structured data (for seo purposes) to a page easily. I’ve already created the interface and I’m now working on getting the filled in fields to be populated in the output.

The only thing that isn’t clear is how to get my output within the section. By default custom brics only seem to get added to the body. Did I miss any documentation on this or is this simply not possible at this moment with the Bric Builder?

Limited experience here with that. But last year I attempted to make a bric for adding OpenGraph to a page header. Which I did achieve, the issue I did have was since I was adding it via JavaScript it would never be picked up by the FB scrapper and so became pointless :joy:

@Jannis no doubt will have a suggestion?

2 Likes

Facebook does not execute JavaScript for its page scrapper.

2 Likes

I found that out the hard way :joy:

1 Like

Thanks for the input so far guys :slight_smile: I’ll try and see if I can get it done via javascript. After all, I only need Google to index it. It’s not something visible on the site or anything, so Facebook not executing it shouldn’t be an issue.