Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

195
Vistas
Read all cookies in GTM template without knowing specific cookie names (using sandboxed JS)

My website refers traffic to ecom site's product pages and uses a GTM tag to create a 1st party cookie recording the visit. The cookie name is something like visit_[product sku] e.g. visit_12789723.

I'm creating another GTM template which ecom sites will add as a tag to their sale completion page e.g. when conversion occurs.

At the point of sales conversion I need to read all cookies created when product pages were visited e.g. "visit_*". The sandboxed JS provides an API to read cookies - getCookieValues. The problem is getCookieValues requires that you pass in the name of the cookie and it passes back the value.

Is there a way to get all cookies or to use wildcards with the available GTM js API?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you are okay with obeying the words of the law rather than the spirit, you can create a Javascript variable "document.cookie" and pass the in via a field to your template. Then you can do some custom parsing to get the individual names and values.

GTM JS variable to retrieve the whole cookie string

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda