let getLocation = () => {
const countryArr = document.cookie.split('; ').filter(cookie => cookie.includes("arc-geo"));
if(countryArr.length > 0) {
const regGeo = /arc-geo={"country_code":"|"}/g
const country = countryArr[0].replace(regGeo,'');
return (country);
}
return false;
}
let getPathname = () => {
return 'https://www.metro.pr'+location.pathname;
}
MetroDataLayer = [{
'article_id': '',
'page_title': 'Noticias, Deportes y Entretenimiento de Puerto Rico y el Mundo | Metro - Metro Puerto Rico',
'pub_date': '',
'autor_name': 'null',
'channel_name': '',
'sub_channel_names': '',
'content_type': 'Homepage',
'canonical_link': 'https://www.metro.pr',
'statusCode' : '200',
'current_link': '',
'forcedContent' : 'false',
"main_category":"N/A",
"GPT":"false",
"sourceInArc":"N/A",
"origin":"N/A",
"originURL":"N/A",
"isShared" : "",
"isSharedIn" : "",
"isCloned":"false"
,
'main_zone': getLocation()
}
];
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'article_id': '',
'page_title': 'Noticias, Deportes y Entretenimiento de Puerto Rico y el Mundo | Metro - Metro Puerto Rico',
'pub_date': '',
'autor_name': 'null',
'channel_name': '',
'sub_channel_names': '',
'content_type': 'Homepage',
'canonical_link': 'https://www.metro.pr',
'statusCode' : '200',
'current_link': '',
'forcedContent' : 'false',
"main_category":"N/A",
"GPT":"false",
"sourceInArc":"N/A",
"origin":"N/A",
"originURL":"N/A",
"isShared" : "",
"isSharedIn" : "",
"isCloned":"false"
,
'main_zone': getLocation()
}
);