//Google strukturierte Daten Weitergabe
const mainLocations = ["Berlin", "Hamburg", "Essen", "Heppenheim"];
function run() {
const applicationForm = document.getElementById("application-form");
const applicationButton = document.getElementById("application-button");
const jobNotFound = document.getElementById("job-not-found");
if (!document.getElementById("job-title")) {
applicationForm.style.display = "none";
applicationButton.style.display = "none";
return;
} else {
jobNotFound.style.display = "none";
}
const title = document.getElementById("job-title").innerHTML;
const miscData = document.getElementById("job-miscData").dataset;
const description = document.getElementById("job-description").innerHTML;
const id = miscData.id;
const employmentType = miscData.employmentType;
const schedule = miscData.schedule
const office = miscData.office
const createdAt = miscData.createdAt;
let location = {
"@type": "Place",
"address": {
"@type": "PostalAddress",
"addressCountry": "DE",
"addressLocality": null
}
};
location.address.addressLocality = office;
if (office === "Wien")
location.address.addressCountry = "AT";
if (office === "Alle Standorten") {
location = [];
for (const city of mainLocations)
location.push({
"@type": "Place",
"address": {
"@type": "PostalAddress",
"addressCountry": "DE",
"addressLocality": city
}
});
}
const json = {
"@context": "https://schema.org/",
"@type": "JobPosting",
"title": title,
"description": description,
"datePosted": createdAt,
"employmentType": employmentType,
"hiringOrganization": {
"@type": "Organization",
"name": "Enlite",
"sameAs": "https://www.enlite.de/",
"logo": "https://enlite.de/wp-content/uploads/sites/6/2024/05/ENLITE-logo.png"
},
"jobLocation": location,
"directApply": true
};
const structuredData = JSON.stringify(json);
const script = document.createElement('script');
script.setAttribute('type', 'application/ld+json');
script.textContent = structuredData;
document.head.appendChild(script);
}
window.onload = run;
Jetzt bewerben
function run() {
const form = document.querySelector('#application-form form');
const miscData = document.getElementById("job-miscData").dataset;
const notices = document.getElementsByClassName('form-submission-notices')[0];
document.querySelector("#job-id input").value = miscData.id;
form.action = "/wp-json/personio/v1/recruiting";
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const channel = urlParams.get('_pc');
if (channel) {
document.querySelector("#recruiting-channel input").value = channel;
}
const displayMessage = (message, success) => {
notices.innerHTML = `
${message}
