<?php session_start(); 
include '../config.php';
include '../checkSession.php';

function current_url()
{
    $url      = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    $validURL = str_replace("&", "&amp", $url);
    return $validURL;
}
$page_url = current_url();

if(strlen($titulopag)<1){
  $titpag ='';
}
else{
  $titpag = strip_tags($titulopag);
}

if(strlen($_SESSION['Query'])>90 && strlen($_COOKIE['persistID'])<2)
{
    $response = $_SESSION['Query'];
    //echo $response;
}
else{
  $curl = curl_init();
  curl_setopt_array($curl, array(
    CURLOPT_URL => $endpoint_graph_cms,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS =>'{"query":"query MyQuery {\\r\\n  metadatosHtml(stage: PUBLISHED) {\\r\\n    contenidoMetadato\\r\\n    metadatoNombre\\r\\n    localizations {\\r\\n      contenidoMetadato\\r\\n      metadatoNombre\\r\\n    }\\r\\n  }\\r\\n  generalidadesDelSitio(stage: PUBLISHED) {\\r\\n    direccionIndeval\\r\\n    logotipoPrincipal\\r\\n  tituloMarketData\\r\\n  textoMarketData\\r\\n   imagenMarketData\\r\\n   linkMarketData\\r\\n  cssAdicional\\r\\n  jsAdicional\\r\\n  baseurl\\r\\n  bucket\\r\\n cloudfront\\r\\n    tituloColumna1Footer\\r\\n    tituloColumna2Footer\\r\\n    tituloColumna3Footer\\r\\n    imagenBuzonDeTransparencia\\r\\n    linkBuzonDeTransparencia\\r\\n    textoCopyright\\r\\n    imagenLogoFooter\\r\\n    localizations {\\r\\n      direccionIndeval\\r\\n       tituloMarketData\\r\\n  textoMarketData\\r\\n   imagenMarketData\\r\\n   linkMarketData\\r\\n  cssAdicional\\r\\n  jsAdicional\\r\\n    logotipoPrincipal\\r\\n      tituloColumna1Footer\\r\\n      tituloColumna2Footer\\r\\n      tituloColumna3Footer\\r\\n      textoCopyright\\r\\n      imagenLogoFooter\\r\\n      imagenBuzonDeTransparencia\\r\\n      textoBuzonDeTransparencia\\r\\n    }\\r\\n    textoBuzonDeTransparencia\\r\\n  colorPrincipal\\r\\n  colorSecundario\\r\\n actionCardOscuro\\r\\n  actionCardClaro\\r\\n  fondoBotones\\r\\n   colorBotones\\r\\n  fondoEnlacesFooter\\r\\n   colorEnlacesFooter\\r\\n  colorBullets\\r\\n  colorTextosPrincipales\\r\\n colorSubtitulos\\r\\n  colorTextoGeneralParrafos\\r\\n  tipografiaPrincipalNombre\\r\\n  tipografiaPrincipalRuta\\r\\n tipografiaSecundariaNombre\\r\\n   tipografiaSecundariaRuta\\r\\n }\\r\\n  redesSociales( stage: PUBLISHED, where: {estatus: \\"publicado\\"}) {\\r\\n    icono\\r\\n    link\\r\\n    localizations {\\r\\n      nombre\\r\\n      link\\r\\n      icono\\r\\n    }\\r\\n    nombre\\r\\n  }\\r\\n  ligasDeInteres( stage: PUBLISHED, where: {estatus: \\"publicado\\"}) {\\r\\n    logotipo\\r\\n    link\\r\\n  }\\r\\n  enlacesFooter( stage: PUBLISHED, where: {estatus: \\"publicado\\"}) {\\r\\n    columnaFooter\\r\\n    link\\r\\n    tituloEnlace\\r\\n    localizations {\\r\\n      tituloEnlace\\r\\n      columnaFooter\\r\\n      link\\r\\n    }\\r\\n  }\\r\\n  trackPixelOScripts(stage: PUBLISHED) {\\r\\n    script\\r\\n  }\\r\\n  paginasHome(stage: PUBLISHED) {\\r\\n    articuloEncabezado\\r\\n    articuloLinkBoton\\r\\n    articuloTexto\\r\\n    articuloTextoBoton\\r\\n    articuloTitulo\\r\\n    imagenInferior\\r\\n    imagenLateral\\r\\n    linkVideoInferior\\r\\n    eventoEnlaceInferior\\r\\n    eventoFecha\\r\\n    eventoTitulo\\r\\n    eventoTituloInferior\\r\\n    eventoBoton\\r\\n    eventoLInkBoton\\r\\n    localizations {\\r\\n      articuloEncabezado\\r\\n      articuloLinkBoton\\r\\n      articuloTexto\\r\\n      articuloTextoBoton\\r\\n      articuloTitulo\\r\\n      imagenInferior\\r\\n      imagenLateral\\r\\n      linkVideoInferior\\r\\n      eventoTituloInferior\\r\\n      eventoTitulo\\r\\n      eventoFecha\\r\\n      eventoEnlaceInferior\\r\\n      eventoBoton\\r\\n      eventoLInkBoton\\r\\n  }\\r\\n  }\\r\\n  bannersHome( stage: PUBLISHED, where: {estatus: \\"publicado\\"}) {\\r\\n    enlaceBoton\\r\\n    imagenDeFondo\\r\\n    titulo\\r\\n    subtitulo\\r\\n    textoBoton\\r\\n    localizations {\\r\\n      enlaceBoton\\r\\n      imagenDeFondo\\r\\n      titulo\\r\\n      subtitulo\\r\\n      textoBoton\\r\\n    }\\r\\n  }\\r\\n  menusPrincipales( stage: PUBLISHED, where: {estatus: \\"publicado\\"}) {\\r\\n    tieneSubmenu\\r\\n    titulo\\r\\n    link\\r\\n    localizations {\\r\\n      link\\r\\n      tieneSubmenu\\r\\n      titulo\\r\\n    }\\r\\n  }\\r\\n  subMenusSuperior( stage: PUBLISHED, where: {estatus: \\"publicado\\"}) {\\r\\n    categoriaPadre\\r\\n    enlace\\r\\n    tituloEnlace\\r\\n    localizations {\\r\\n      enlace\\r\\n      tituloEnlace\\r\\n      categoriaPadre\\r\\n    }\\r\\n  }\\r\\n  enlacesSuperiores( stage: PUBLISHED, where: {estatus: \\"publicado\\"}) {\\r\\n    icono\\r\\n    link\\r\\n    titulo\\r\\n    localizations {\\r\\n      icono\\r\\n      link\\r\\n      titulo\\r\\n    }\\r\\n  }\\r\\n  paginasComunicadosYEventos(stage: PUBLISHED) {\\r\\n    aviso1Texto\\r\\n    aviso1TextoBoton\\r\\n    aviso1Titulo\\r\\n    aviso2Enlace\\r\\n    aviso2Texto\\r\\n    aviso1Enlace\\r\\n    aviso2TextoBoton\\r\\n    aviso2Titulo\\r\\n    tituloDePagina\\r\\n    tituloFiltros\\r\\n    slug\\r\\n    localizations {\\r\\n      aviso1Enlace\\r\\n      aviso1Texto\\r\\n      aviso1TextoBoton\\r\\n      aviso1Titulo\\r\\n      aviso2Enlace\\r\\n      aviso2Texto\\r\\n      aviso2TextoBoton\\r\\n      aviso2Titulo\\r\\n      tituloDePagina\\r\\n      tituloFiltros\\r\\n      slug\\r\\n    }\\r\\n  }\\r\\n  contacto(where: {id: \\"ckl9tjo0816dk0a296ojadu3a\\"}, stage: PUBLISHED) {\\r\\n    etiquetaEmail\\r\\n    etiquetaEmpresa\\r\\n    etiquetaMensaje\\r\\n    etiquetaNombre\\r\\n    texto\\r\\n    titulo\\r\\n    textoBoton\\r\\n    textoCerrar\\r\\n    localizations {\\r\\n      etiquetaEmail\\r\\n      etiquetaEmpresa\\r\\n      etiquetaMensaje\\r\\n      etiquetaNombre\\r\\n      texto\\r\\n      titulo\\r\\n      textoBoton\\r\\n      textoCerrar\\r\\n    }\\r\\n  }\\r\\n  enlacesPaginaHome(orderBy: id_DESC, stage: PUBLISHED, where: {estatus: \\"publicado\\"}) {\\r\\n    encabezado\\r\\n    enlaceBoton\\r\\n    texto\\r\\n    textoBoton\\r\\n    titulo\\r\\n    video\\r\\n    localizations {\\r\\n      encabezado\\r\\n      enlaceBoton\\r\\n      texto\\r\\n      textoBoton\\r\\n      titulo\\r\\n      video\\r\\n    }\\r\\n  }\\r\\n}\\r\\n","variables":{}}',
    CURLOPT_HTTPHEADER => array(
      'Content-Type: application/json',
      'Cookie: __cfduid=da2693cdfd39b7377a8a05e305da45b8f1613001694'
    ),
  ));
  $response = curl_exec($curl);
  //echo "ss" .$response;
  $_SESSION['Query'] = $response;
  curl_close($curl);
}

//echo $response;
$array = json_decode($response, true);

///////// PARAMETRIZABLES
//$baseurl = $array['data']['generalidadesDelSitio'][0]['baseurl'];
//$bucket = $array['data']['generalidadesDelSitio'][0]['bucket'];
//$cloudfront = $array['data']['generalidadesDelSitio'][0]['cloudfront'];

//LOGO INDEVAL
$logoIndeval = $array['data']['generalidadesDelSitio'][0]['logotipoPrincipal'];




////////////////COLORES

$colorPrincipal = $array['data']['generalidadesDelSitio'][0]['colorPrincipal'];  
$colorSecundario = $array['data']['generalidadesDelSitio'][0]['colorSecundario']; 
$actionCardOscuro = $array['data']['generalidadesDelSitio'][0]['actionCardOscuro']; 
$actionCardClaro = $array['data']['generalidadesDelSitio'][0]['actionCardClaro']; 

$fondoBotones = $array['data']['generalidadesDelSitio'][0]['fondoBotones'];  
$colorBotones = $array['data']['generalidadesDelSitio'][0]['colorBotones']; 
$fondoEnlacesFooter = $array['data']['generalidadesDelSitio'][0]['fondoEnlacesFooter']; 
$colorEnlacesFooter = $array['data']['generalidadesDelSitio'][0]['colorEnlacesFooter']; 

$colorBullets = $array['data']['generalidadesDelSitio'][0]['colorBullets'];  
$colorTextosPrincipales = $array['data']['generalidadesDelSitio'][0]['colorTextosPrincipales']; 
$fondoEnlacesFooter = $array['data']['generalidadesDelSitio'][0]['fondoEnlacesFooter']; 
$colorSubtitulos = $array['data']['generalidadesDelSitio'][0]['colorSubtitulos']; 
$colorTextoGeneralParrafos = $array['data']['generalidadesDelSitio'][0]['colorTextoGeneralParrafos']; 


///////////////TIPOGRAFÍAS

$tipografiaPrincipalNombre = $array['data']['generalidadesDelSitio'][0]['tipografiaPrincipalNombre'];  
$tipografiaPrincipalRuta = $array['data']['generalidadesDelSitio'][0]['tipografiaPrincipalRuta']; 
$tipografiaSecundariaNombre = $array['data']['generalidadesDelSitio'][0]['tipografiaSecundariaNombre']; 
$tipografiaSecundariaRuta = $array['data']['generalidadesDelSitio'][0]['tipografiaSecundariaRuta']; 


//LOGO FOOTER
$logoFooter = $array['data']['generalidadesDelSitio'][0]['imagenLogoFooter'];

//CSS - JS
$cssAdicional = $array['data']['generalidadesDelSitio'][0]['cssAdicional'];
$jsAdicional = $array['data']['generalidadesDelSitio'][0]['jsAdicional'];

///////HOME
if($lang == 'en'){
  
  $buzonTexto = $array['data']['generalidadesDelSitio'][0]['textoBuzonDeTransparencia'];
    ///////BUZÓN DE TRANSPARENCIA
  $buzonImagen = $array['data']['generalidadesDelSitio'][0]['imagenBuzonDeTransparencia'];
  $buzonLink = $array['data']['generalidadesDelSitio'][0]['linkBuzonDeTransparencia']."?locale=en";
  //METADATOS
  $titulo = $array['data']['metadatosHtml'][0]['contenidoMetadato'];
  $descripcion = $array['data']['metadatosHtml'][1]['contenidoMetadato'];

  $bannerHomeLateral = $array['data']['paginasHome'][0]['imagenLateral'];
  $bannerHomeInferior = $array['data']['paginasHome'][0]['imagenInferior'];
  $articuloEncabezado = $array['data']['paginasHome'][0]['articuloEncabezado'];
  $articuloTitulo = $array['data']['paginasHome'][0]['articuloTitulo'];
  $articuloTexto = $array['data']['paginasHome'][0]['articuloTexto'];
  $articuloLinkBoton = $array['data']['paginasHome'][0]['articuloLinkBoton'];
  $articuloTextoBoton = $array['data']['paginasHome'][0]['articuloTextoBoton'];
  $titEventoDestacado = $array['data']['paginasHome'][0]['eventoTitulo'];  
  $fechaEventoDestacado = $array['data']['paginasHome'][0]['eventoFecha'];
  $botonEventoDestacado = $array['data']['paginasHome'][0]['eventoBoton'];
  $linkEventoDestacado = $array['data']['paginasHome'][0]['eventoLInkBoton'];
  $linkeventos = $array['data']['paginasHome'][0]['eventoTituloInferior'];  
  $titeventos = $array['data']['paginasHome'][0]['eventoEnlaceInferior'];
  

  //////COLUMNAS FOOTER
  $textoCol1 = $array['data']['generalidadesDelSitio'][0]['tituloColumna1Footer'];
  $textoCol2 = $array['data']['generalidadesDelSitio'][0]['tituloColumna2Footer'];
  $textoCol3 = $array['data']['generalidadesDelSitio'][0]['tituloColumna3Footer'];
  //DIRECCION FOOTER
  $direccion = $array['data']['generalidadesDelSitio'][0]['direccionIndeval'];
  //COPYRIGHT FOOTER
  $copyright = $array['data']['generalidadesDelSitio'][0]['textoCopyright'];

  //CONTACTO
  $tituloContacto= $array['data']['contacto']['titulo'];
  $textoForm = $array['data']['contacto']['texto'];
  $etiquetaNombre = $array['data']['contacto']['etiquetaNombre'];
  $etiquetaEmail = $array['data']['contacto']['etiquetaEmail'];
  $etiquetaEmpresa = $array['data']['contacto']['etiquetaEmpresa'];
  $etiquetaMensaje = $array['data']['contacto']['etiquetaMensaje'];
  $textoBotoncontacto = $array['data']['contacto']['textoBoton'];
  $textoCerrar = $array['data']['contacto']['textoCerrar'];
  //LINKS
  $linkeventos = '/overviews-events';
  $titeventos = 'EVENT  S';

  //MARKET DATA
  $tituloMarketData = $array['data']['generalidadesDelSitio'][0]['tituloMarketData'];
  $textoMarketData = $array['data']['generalidadesDelSitio'][0]['textoMarketData'];
  $imagenMarketData = $array['data']['generalidadesDelSitio'][0]['imagenMarketData']; 
  $linkMarketData = $array['data']['generalidadesDelSitio'][0]['linkMarketData'];
}
if($lang == 'es'){
  ///////BUZÓN DE TRANSPARENCIA
  $buzonImagen = $array['data']['generalidadesDelSitio'][0]['imagenBuzonDeTransparencia'];
  $buzonLink = $array['data']['generalidadesDelSitio'][0]['linkBuzonDeTransparencia'];
  $buzonTexto = $array['data']['generalidadesDelSitio'][0]['localizations'][0]['textoBuzonDeTransparencia'];
  //METADATOS
  $titulo = $array['data']['metadatosHtml'][0]['localizations'][0]['contenidoMetadato'];
  $descripcion = $array['data']['metadatosHtml'][1]['localizations'][0]['contenidoMetadato'];

  $bannerHomeLateral = $array['data']['paginasHome'][0]['localizations'][0]['imagenLateral'];
  $bannerHomeInferior = $array['data']['paginasHome'][0]['localizations'][0]['imagenInferior'];
  $articuloEncabezado = $array['data']['paginasHome'][0]['localizations'][0]['articuloEncabezado'];
  $articuloTitulo = $array['data']['paginasHome'][0]['localizations'][0]['articuloTitulo'];
  $articuloTexto = $array['data']['paginasHome'][0]['localizations'][0]['articuloTexto'];
  $articuloLinkBoton = $array['data']['paginasHome'][0]['localizations'][0]['articuloLinkBoton'];
  $articuloTextoBoton = $array['data']['paginasHome'][0]['localizations'][0]['articuloTextoBoton'];
  $titEventoDestacado = $array['data']['paginasHome'][0]['localizations'][0]['eventoTitulo'];  
  $fechaEventoDestacado = $array['data']['paginasHome'][0]['localizations'][0]['eventoFecha'];
  $botonEventoDestacado = $array['data']['paginasHome'][0]['localizations'][0]['eventoBoton']; 
  $linkEventoDestacado = $array['data']['paginasHome'][0]['localizations'][0]['eventoLInkBoton'];
  $linkeventos = $array['data']['paginasHome'][0]['localizations'][0]['eventoTituloInferior'];  
  $titeventos = $array['data']['paginasHome'][0]['localizations'][0]['eventoEnlaceInferior'];
  
  //////COLUMNAS FOOTER
  $textoCol1 = $array['data']['generalidadesDelSitio'][0]['localizations'][0]['tituloColumna1Footer'];
  $textoCol2 = $array['data']['generalidadesDelSitio'][0]['localizations'][0]['tituloColumna2Footer'];
  $textoCol3 = $array['data']['generalidadesDelSitio'][0]['localizations'][0]['tituloColumna3Footer'];

  //DIRECCION FOOTER
  $direccion = $array['data']['generalidadesDelSitio'][0]['localizations'][0]['direccionIndeval'];

  //COPYRIGHT FOOTER
  $copyright = $array['data']['generalidadesDelSitio'][0]['localizations'][0]['textoCopyright'];
  
  //CONTACTO
  $tituloContacto= $array['data']['contacto']['localizations'][0]['titulo'];
  $textoForm = $array['data']['contacto']['localizations'][0]['texto'];
  $etiquetaNombre = $array['data']['contacto']['localizations'][0]['etiquetaNombre'];
  $etiquetaEmail = $array['data']['contacto']['localizations'][0]['etiquetaEmail'];
  $etiquetaEmpresa = $array['data']['contacto']['localizations'][0]['etiquetaEmpresa'];
  $etiquetaMensaje = $array['data']['contacto']['localizations'][0]['etiquetaMensaje'];
  $textoBotoncontacto = $array['data']['contacto']['localizations'][0]['textoBoton'];
  $textoCerrar = $array['data']['contacto']['localizations'][0]['textoCerrar'];

  //LINKS
  $linkeventos = '/comunicados-eventos';
  $titeventos = 'EVENTOS';

  //MARKET DATA
  $tituloMarketData = $array['data']['generalidadesDelSitio'][0]['localizations'][0]['tituloMarketData'];
  $textoMarketData = $array['data']['generalidadesDelSitio'][0]['localizations'][0]['textoMarketData'];
  $imagenMarketData = $array['data']['generalidadesDelSitio'][0]['localizations'][0]['imagenMarketData']; 
  $linkMarketData = $array['data']['generalidadesDelSitio'][0]['localizations'][0]['linkMarketData'];

}

$articuloTexto = urldecode($articuloTexto);

if(strlen($page_url)>1){

  if($lang =="en"){$locales= "en";}
  if($lang =="es"){$locales= "es_MX";}
  $slugurl = $page_url;
  $slugurl = str_ireplace("https://indeval.trafikatest.com","",$slugurl);
  $slugurl = str_ireplace("http://indeval.trafikatest.com","",$slugurl);

  if($slugurl == "/"){
    $slugurl = '/home';
  }

  //echo $slugurl ;
  //echo  "xx".$page_url;
  $curlseo = curl_init();
	curl_setopt_array($curlseo, array(
		CURLOPT_URL => $endpoint_graph_cms,
		CURLOPT_RETURNTRANSFER => true,
		CURLOPT_ENCODING => '',
		CURLOPT_MAXREDIRS => 10,
		CURLOPT_TIMEOUT => 0,
		CURLOPT_FOLLOWLOCATION => true,
		CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
		CURLOPT_CUSTOMREQUEST => 'POST',
        CURLOPT_POSTFIELDS =>'{"query":"query MyQuery {\\r\\n  seoPaginas(stage: PUBLISHED, where: {_search: \\"'.$slugurl.'\\"}, locales: '.$locales.') {\\r\\n    id\\r\\n    titulo\\r\\n    texto\\r\\n    slug\\r\\n    imagen\\r\\n    localizations {\\r\\n     estatus\\r\\n      id\\r\\n      imagen\\r\\n      slug\\r\\n    texto\\r\\n      titulo\\r\\n    }\\r\\n    estatus\\r\\n  }\\r\\n}\\r\\n","variables":{}}',
		CURLOPT_HTTPHEADER => array(
		  'Content-Type: application/json',
		  'Cookie: __cfduid=da2693cdfd39b7377a8a05e305da45b8f1613001694'
		),
	  ));

   
  $responseseo = curl_exec($curlseo);
  curl_close($curlseo);
  //echo "Slug: ".$slugurl;
  $arrayseo = json_decode($responseseo, true);

  foreach ($arrayseo['data']['seoPaginas'] as $itemseo) {
  }

  if(strlen($itemseo['id'])>5 ||  strlen($subitemseo['id'])>5){
    if($lang == "es"){
      $descripcion = urldecode($itemseo['texto']);
      $titpag = urldecode($itemseo['titulo']);
      $imagenseo = $itemseo['imagen'];
    }
  
    if($lang == "en"){
      $descripcion = urldecode($itemseo['texto']);
      $titpag = urldecode($itemseo['titulo']);
      $imagenseo = $itemseo['imagen'];
    }
  }

  if(strlen($imagenseo)>5){
    $imagenseo = $cloudfront.$itemseo['imagen'];

  }
  else{
    $imagenseo = $base_url."assets/img/indeval_oog.jpg";
  }
}

?>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="<?php echo $descripcion; ?>" />
<meta name="author" content="" />
<title><?php echo urldecode($titpag) . " | ". $titulo; ?></title>
<link rel="icon" type="image/x-icon" href="assets/img/favicon.ico" />

 <!-- OG meta -->
  <meta property="og:title" content="<?php echo urldecode($titpag) . " | ".$titulo; ?>" />
  <meta property="og:type" content="website" />
  <meta property="og:url" content="<?php echo $page_url; ?>" />
  <meta property="og:image" content="<?php echo $imagenseo; ?>" />
  <meta property="og:description" content="<?php echo $descripcion; ?>"/>
  <link rel="image_src" href="<?php echo $imagenseo; ?>" />


<script>
<?php
    //TRACKING PIXELS O CUSTOM SCRIPTS
    foreach ($array['data']['trackPixelOScripts'] as $item) {
        echo $item['script'];
    }
?>
</script> 
<!-- Font Awesome icons (free version)-->
<link href="/assets/fontawesome/css/all.css" rel="stylesheet"> <!--load all styles -->
<!-- Google fonts-->
<link href="https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic" rel="stylesheet" type="text/css" />
<link href="https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700" rel="stylesheet" type="text/css" />
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@100;400;600;700&display=swap" rel="stylesheet" type="text/css" />
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600&display=swap" rel="stylesheet" type="text/css" />
<!-- Core theme CSS (includes Bootstrap)-->
<link href="/css/styles.css" rel="stylesheet" />

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','<?php echo $google_tag;?>');</script>
<!-- End Google Tag Manager -->

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=<?php echo $google_tag;?>"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->