","showSummary":null,"url":"/tri-state-petroleum-honors-founders-scholarships","date":"2011-04-21T00:00:00","author":{"email":"devteam@ashday.com","uname":"eiq_root","firstName":null,"lastName":null,"bio":null,"title":null,"picture":null,"phone":null,"contactForm":null},"digitalEdition":null,"sponsored":false,"taggedPro":null,"teaserImage":null,"topics":[{"name":"Corporate Responsibility","url":"/corporate-responsibility"}],"attachedFiles":[]},{"title":"TravelCenters of America Customers Donate to St. Christopher Fund","id":18350,"bundle":"article","summary":"Truck Drivers raised $3,300 for their peers in need.
","showSummary":null,"url":"/travelcenters-america-customers-donate-st-christopher-fund","date":"2011-04-21T00:00:00","author":{"email":"devteam@ashday.com","uname":"eiq_root","firstName":null,"lastName":null,"bio":null,"title":null,"picture":null,"phone":null,"contactForm":null},"digitalEdition":null,"sponsored":false,"taggedPro":null,"teaserImage":null,"topics":[{"name":"Corporate Responsibility","url":"/corporate-responsibility"}],"attachedFiles":[]},{"title":"Aloha Petroleum Donates $5,000 to the American Red Cross, Hawaii Chapter","id":18305,"bundle":"article","summary":"Special donation canisters are also present at all Aloha Island Mart locations.","showSummary":null,"url":"/aloha-petroleum-donates-5000-american-red-cross-hawaii-chapter","date":"2011-04-13T00:00:00","author":{"email":"devteam@ashday.com","uname":"eiq_root","firstName":null,"lastName":null,"bio":null,"title":null,"picture":null,"phone":null,"contactForm":null},"digitalEdition":null,"sponsored":false,"taggedPro":null,"teaserImage":null,"topics":[{"name":"Corporate Responsibility","url":"/corporate-responsibility"}],"attachedFiles":[]},{"title":"TravelCenters of America Founder Donates $10 Million to NY Medical Center","id":18244,"bundle":"article","summary":"E. Philip Saunders' gift supports research at University of Rochester Medical Center.","showSummary":null,"url":"/travelcenters-america-founder-donates-10-million-ny-medical-center","date":"2011-04-05T00:00:00","author":{"email":"devteam@ashday.com","uname":"eiq_root","firstName":null,"lastName":null,"bio":null,"title":null,"picture":null,"phone":null,"contactForm":null},"digitalEdition":null,"sponsored":false,"taggedPro":null,"teaserImage":null,"topics":[{"name":"Corporate Responsibility","url":"/corporate-responsibility"}],"attachedFiles":[]},{"title":"GPM Supports Military Families","id":18173,"bundle":"article","summary":"Convenience retailer raises more than $66,000 for Support U.S. Armed Forces.","showSummary":null,"url":"/gpm-supports-military-families","date":"2011-03-25T00:00:00","author":{"email":"devteam@ashday.com","uname":"eiq_root","firstName":null,"lastName":null,"bio":null,"title":null,"picture":null,"phone":null,"contactForm":null},"digitalEdition":null,"sponsored":false,"taggedPro":null,"teaserImage":null,"topics":[{"name":"Corporate Responsibility","url":"/corporate-responsibility"}],"attachedFiles":[]},{"title":"Sheetz Opens in West Virginia With Prizes","id":18171,"bundle":"article","summary":"First 50 customers in line received a $100 Sheetz Z-card.","showSummary":null,"url":"/sheetz-opens-west-virginia-prizes","date":"2011-03-24T00:00:00","author":{"email":"devteam@ashday.com","uname":"eiq_root","firstName":null,"lastName":null,"bio":null,"title":null,"picture":null,"phone":null,"contactForm":null},"digitalEdition":null,"sponsored":false,"taggedPro":null,"teaserImage":null,"topics":[{"name":"Corporate Responsibility","url":"/corporate-responsibility"}],"attachedFiles":[]},{"title":"PS Food Mart Raises Money for Food Banks in Michigan and Ohio","id":18108,"bundle":"article","summary":"Chain teams with Folk Oil to support "Fight Hunger. Give Hope" campaign.","showSummary":null,"url":"/ps-food-mart-raises-money-food-banks-michigan-and-ohio","date":"2011-03-15T00:00:00","author":{"email":"devteam@ashday.com","uname":"eiq_root","firstName":null,"lastName":null,"bio":null,"title":null,"picture":null,"phone":null,"contactForm":null},"digitalEdition":null,"sponsored":false,"taggedPro":null,"teaserImage":null,"topics":[{"name":"Corporate Responsibility","url":"/corporate-responsibility"}],"attachedFiles":[]},{"title":"Wilson Farms Raises $17,775 for \"Check Out Hunger\"","id":18058,"bundle":"article","summary":"Monthlong campaign marks sixth consecutive year of support.","showSummary":null,"url":"/wilson-farms-raises-17775-check-out-hunger","date":"2011-03-08T00:00:00","author":{"email":"devteam@ashday.com","uname":"eiq_root","firstName":null,"lastName":null,"bio":null,"title":null,"picture":null,"phone":null,"contactForm":null},"digitalEdition":null,"sponsored":false,"taggedPro":null,"teaserImage":null,"topics":[{"name":"Corporate Responsibility","url":"/corporate-responsibility"}],"attachedFiles":[]},{"title":"Stripes Raising Funds for Children's Miracle Network With Miracle Balloons","id":18060,"bundle":"article","summary":"Chain also stocking Monkey Juice, sold exclusively at Stripes, where a portion of the profits go to CMN.","showSummary":null,"url":"/stripes-raising-funds-childrens-miracle-network-miracle-balloons","date":"2011-03-08T00:00:00","author":{"email":"devteam@ashday.com","uname":"eiq_root","firstName":null,"lastName":null,"bio":null,"title":null,"picture":null,"phone":null,"contactForm":null},"digitalEdition":null,"sponsored":false,"taggedPro":null,"teaserImage":null,"topics":[{"name":"Corporate Responsibility","url":"/corporate-responsibility"}],"attachedFiles":[]},{"title":"Mac's Convenience Stores Launches Operation Heat 2011","id":17972,"bundle":"article","summary":"C-store chain partners with Ontario Provincial Poice to offer coupons to youth doing good deeds.
","showSummary":null,"url":"/macs-convenience-stores-launches-operation-heat-2011","date":"2011-02-22T00:00:00","author":{"email":"devteam@ashday.com","uname":"eiq_root","firstName":null,"lastName":null,"bio":null,"title":null,"picture":null,"phone":null,"contactForm":null},"digitalEdition":null,"sponsored":false,"taggedPro":null,"teaserImage":null,"topics":[{"name":"Corporate Responsibility","url":"/corporate-responsibility"}],"attachedFiles":[]}]},"title":"Corporate Responsibility","contentParagraphs":null,"sections":null};
const country = "US";
const language = null;
const SITE_LANGUAGE = "en";
const siteName = "Convenience Store News";
const userRoles = ["anonymous"];
const userUid = 0;
const indexName = "csnews";
const title = "Corporate Responsibility | Convenience Store News";
window.dataLayer = window.dataLayer || [];
const data = {};
data.entityTaxonomy = {};
const contentTypes = [
"article",
"blog",
"bulletin",
"embed_page",
"landing_page",
"event",
"image",
"page",
"product",
"whitepaper",
"video",
"tags",
"author_profile",
"buyers_guide_listing"
];
if (
routeInfo &&
"bundle" in routeInfo &&
contentTypes.includes(routeInfo["bundle"])
) {
data.entityBundle = routeInfo.bundle;
data.entityTitle = title || `${routeInfo.title} | ${siteName}`;
data.entityId = routeInfo.id;
data.entityName = routeInfo.author?.uname;
data.entityCreated = routeInfo.created;
data.sponsored = routeInfo.sponsored;
data.sponsor = routeInfo.sponsoringCompany;
data.entityType = "node";
data.entityLangcode = SITE_LANGUAGE;
data.siteName = siteName;
data.drupalLanguage = language;
data.drupalCountry = country;
data.userRoles = userRoles;
data.userUid = userUid;
data.entityTaxonomyKeys = {};
data.entityTaxonomyHierarchies = {};
data.parentNaicsCode = {};
data.isPro = false;
data.algoliaIndexName = indexName;
// Add taxonomy data
const taxonomies = {
businessTopic: "business_topic",
contentType: "content_type",
company: "company",
marketSegment: "market_segment",
};
const getHierarchy = (term, terms = []) => {
terms.push({ id: term.id, name: term.name });
if (term.parentTerm != null) {
getHierarchy(term.parentTerm, terms);
}
return terms;
};
const getTerms = (term, useApiId = false) => {
return { id: useApiId ? term.apiId : term.id, name: term.name };
};
const getKeys = (term) => {
return { id: term.id, name: term.apiId };
};
Object.entries(taxonomies).forEach(([key, item]) => {
terms = routeInfo[key];
if (terms && terms.length > 0) {
data["entityTaxonomy"][item] = terms.map((term) =>
getTerms(term, key === "company")
);
if (key !== "company") {
data["entityTaxonomyKeys"][item] = terms.map(getKeys);
termGroups = [];
terms.forEach((term, termInd) => {
termGroups[termInd] = getHierarchy(term);
});
data["entityTaxonomyHierarchies"][item] = termGroups;
}
}
});
data["entityTaxonomy"]["tags"] = routeInfo["topics"] || [];
// Primary Topic is either the business topic or the top tag.
if (routeInfo["businessTopic"]?.length > 0) {
data["entityPrimaryTopic"] = routeInfo["businessTopic"][0]["name"];
} else {
if (routeInfo["topics"]?.length > 0) {
data["entityPrimaryTopic"] = routeInfo["topics"][0]["name"];
}
}
// Primary and secondary entityNaicsCodes come from the MarketSegment
if (routeInfo.marketSegment?.length > 0) {
data.entityNaicsCode = {};
data["entityNaicsCode"]["id"] = routeInfo["marketSegment"][0]["id"];
data["entityNaicsCode"]["name"] =
routeInfo["marketSegment"][0]["naicsCode"];
if (routeInfo["marketSegment"][0]["parentTerm"] != null) {
data["parentNaicsCode"]["id"] =
routeInfo["marketSegment"][0]["parentTerm"]["id"];
data["parentNaicsCode"]["name"] =
routeInfo["marketSegment"][0]["parentTerm"]["naicsCode"];
}
} else {
data.entityNaicsCode = [];
}
if (routeInfo.taggedPro) {
data.isPro = routeInfo.taggedPro;
}
window.dataLayer.push(data);
} else if (routeInfo && "vid" in routeInfo) {
data.entityBundle = "tags";
data.entityTitle = routeInfo.name;
data.entityId = routeInfo.id;
data.entityName = routeInfo.author?.uname;
data.entityCreated = routeInfo.created;
data.entityType = "taxonomy_term";
data.entityLangcode = SITE_LANGUAGE;
data.siteName = siteName;
data.sponsored = routeInfo.sponsored;
data.sponsor = routeInfo.sponsoringCompany;
data.drupalLanguage = language;
data.drupalCountry = country;
data.userRoles = userRoles;
data.userUid = userUid;
data.algoliaIndexName = indexName;
data["entityTaxonomy"]["tags"] = {
id: routeInfo["id"],
name: routeInfo["name"],
};
window.dataLayer.push(data);
}
})();