","alternateLabel":null,"teaserImage":{"id":24052,"url":"https://assets1.risnews.com/styles/secondary_articles_short/s3/ris_RetailIQ_0516_teaser.jpg?itok=wVWDXXUS","width":196,"alt":null,"height":216},"sponsored":false,"businessTopic":[],"company":[],"contentType":[]},{"title":"Three Ways Shopper Data Can Support Segmentation Strategies","id":1634,"bundle":"article","summary":"Here are the three best practices to create and use segmentation in today’s multichannel environment.","showSummary":null,"url":"/three-ways-shopper-data-can-support-segmentation-strategies","date":"2016-03-11T00:00:00","author":{"email":"devteam@ashday.com","uname":"ash_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":"Data Synchronization","url":"/data-synchronization"},{"name":"Data Warehousing","url":"/data-warehousing"},{"name":"Data Management","url":"/data-management"},{"name":"E-mail","url":"/e-mail"},{"name":"E-Commerce","url":"/e-commerce"},{"name":"Mobile Devices","url":"/mobile-devices"},{"name":"E-Commerce Platform","url":"/e-commerce-platform"},{"name":"Text Messaging","url":"/text-messaging"},{"name":"Marketing","url":"/marketing"},{"name":"Security","url":"/security"},{"name":"Big Data","url":"/big-data"},{"name":"Unstructured Data","url":"/unstructured-data"},{"name":"Omnichannel","url":"/omnichannel"}],"attachedFiles":[]},{"title":"TouchCommerce Looks to Solve the Traditional Advertising ROI Conundrum ","id":2113,"bundle":"article","summary":"Its latest solution, TouchMedia, enables retailers to transform their media messaging into rich, interactive conversations using personalized engagement tools. ","showSummary":null,"url":"/touchcommerce-looks-solve-traditional-advertising-roi-conundrum","date":"2015-06-10T00:00:00","author":{"email":"devteam@ashday.com","uname":"ash_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":"Business Intelligence (BI)","url":"/business-intelligence"},{"name":"Omnichannel","url":"/omnichannel"},{"name":"Customer Service","url":"/customer-service"},{"name":"Digital Transformation","url":"/digital-transformation"},{"name":"Machine Learning","url":"/machine-learning"},{"name":"Mobile Commerce","url":"/mobile-commerce"},{"name":"Text Messaging","url":"/text-messaging"},{"name":"Big Data","url":"/big-data"},{"name":"Mobile Strategy","url":"/mobile-strategy"},{"name":"Customer Experience","url":"/customer-experience"}],"attachedFiles":[]},{"title":"Avoiding the Pitfalls of Mobile EMV Compliance","id":2208,"bundle":"whitepaper","url":"/avoiding-pitfalls-mobile-emv-compliance","date":"2015-04-07T00:00:00","author":{"email":"devteam@ashday.com","uname":"ash_root","firstName":null,"lastName":null,"bio":null,"title":null,"picture":null,"phone":null,"contactForm":null},"summary":"Download this Roadmap report and discover the hidden pitfalls when deploying an EMV compliant payment solution and how savvy retailers are avoiding them.","body":"As retail prepares for the upcoming EMV mandate retailers processing payments via mobile devices have a unique set of concerns. Download this Roadmap report and discover the hidden pitfalls and how savvy retailers are avoiding them when deploying an EMV compliant payment solution.
","alternateLabel":null,"teaserImage":{"id":23476,"url":"https://assets1.risnews.com/styles/secondary_articles_short/s3/ris_Roadmap_4_7_15_teaser.jpg?itok=ssF4q-oT","width":196,"alt":null,"height":216},"sponsored":false,"businessTopic":[],"company":[],"contentType":[]}]},"title":"Text Messaging"};
const country = "HK";
const language = "en, *";
const SITE_LANGUAGE = "en";
const siteName = "RIS News";
const userRoles = ["anonymous"];
const userUid = 0;
const indexName = "risnews";
window.dataLayer = window.dataLayer || [];
const data = {};
data.entityTaxonomy = {};
const contentTypes = [
"article",
"blog",
"bulletin",
"embed_page",
"landing_page",
"event",
"image",
"page",
"product",
"whitepaper",
"video",
"tags",
];
if (
routeInfo &&
"bundle" in routeInfo &&
contentTypes.includes(routeInfo["bundle"])
) {
data.entityBundle = routeInfo.bundle;
data.entityTitle = `${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 toxonomy 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);
}
})();