Hey everyone, I’m an SEO with no experience with HubSpot and want to add job schema/structured data to a client’s job posts.
I think I understand the difference between Template vs Module implementations. Still, I am stuck when it comes to HubSpot’s Developer Info for identifying HubSpot variables used to populate the JSON-LD values. What are the variables I should be using to populate the JSON-LD values?
Any help would be very much appreciated!
Simon
Hi @SWilson5
There isn’t a standard jobs module/data on HubSpot so unfortunately there’s not going to be a straightforward answer to this, it depends on how the client’s page is implemented.
The data they have for their jobs could be stored in a module field, a HubDB field or even just be text on a page and not have any particular variables.
If they’re using a module, I would probably update the module and use its field in your schema. So if you have a field that’s “Job Title” with the name job_title, you might add this to the HTML in the module:
{% require_js position="head" %}
<script type="application/ld+json">
{
"@context" : "https://schema.org/",
"@type" : "JobPosting",
"title" : "{{ module.job_title }}"
}
</script>
{% end_require_js %}
That adds the script to your header and uses’s the module’s module.job_title to add the title. Other properties would be similar.
But the data might not be structured that way. There are some more options here, but if you link to a sample page in question (or send me a DM with a link to the page), I can probably give you more specific advice.
I hope that helps!
Stephanie
Stephanie O’Gay Garcia
Freelance HubSpot CMS Developer
Website | Contact
Update: Simon sent a private message with a link to the page, here’s my response for anyone looking to add schema to a HubDB dynamic page.
Hey Simon!
This looks like it’s built with HubDB as a dynamic page which means that:
- Under Marketing > Files and Template > HubDB on your portal’s navigation there should be a table with the jobs. The column names are what you’ll use in your schema to reference the data, each row will be generating a new job.
- There’s a single template/page for both the job listings and job posts page, and each job post page is generated automatically using the page path specified in the HubDB table.
It’ll be built slightly differently depending on the developer, but there should be a condition somewhere (on the page’s template or module) that separates the listing content from the post content and it’ll look like this:
{% if dynamic_page_hubdb_row %}
{# Content for the job post page goes here #}
{% else %}
{# Content for the job listing page goes here #}
{% endif %}
(Pro Tip: to find a module’s code, go into the Edit mode of a page and add ?developerMode=true to the URL, then when you click on the module, at the bottom there will be a “Open in Design Manager” option).
You’ll want to add the Job Posting Schema to the job post page (under the {% if dynamic_page_hubdb_row %} condition). Use {{ dynamic_page_hubdb_row.[[ column name ]] }} to reference the data, where [[ column name ]] is what appears when you hover over the column’s label:
HubDB - Column name appears when hovering over the label
So your code is ultimately going to look something like:
{% if dynamic_page_hubdb_row %}
{% require_js position="head" %}
<script type="application/ld+json">
{
"@context" : "https://schema.org/",
"@type" : "JobPosting",
"title" : "{{ dynamic_page_hubdb_row.hs_name }}"
}
</script>
{% end_require_js %}
{# Content for the job post page goes here #}
{% else %}
{# Content for the job listing page goes here #}
{% endif %}
And you can add to that with more elements of the Job Posting Schema.
Hopefully that makes sense!
Stephanie O’Gay Garcia
Freelance HubSpot CMS Developer
Website | Contact