Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

google-tag-manager add identify properties to dataLayer

Abierto
#693 0 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
30/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
javascript
Área
analytics

Línea de trabajo

Reproduce the Segment identify call shown in the issue and inspect window.dataLayer in the Google Tag Manager integration. First determine the intended identify-to-dataLayer behavior and review existing integration entry points and tests, which the issue does not name. Done should define and verify how account and contact become available without an eventless track or manual dataLayer injection.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Hi,

Currently the Segment identify method does not push any user properties to the GTM data layer. Should it?

in the app code

 window?.analytics?.identify('userId123', {
      account: '12345678',
      contact: '[email protected]',
    });

but when you console.log the window.dataLayer, you only have the page event which is missing the user properties like account and contact

[{
event: "Loaded a Page"
gtm.uniqueEventId: 1
path: "/blah"
referrer: "blah"
search: ""
segmentAnonymousId: "123123123"
title: "blah"
url: "blah"
userId: "userId123"
}]

This means if I want to use the account property as a dataLayer variable in GTM then I need to explicitly call an eventless track on page load with it, or inject it into the dataLayer manually.

Both approaches seem to go against the Segment best practice.

What should the expected behaviour be?

Lenguaje dominante
JavaScript
Estrellas
125
Forks
134
Merge medio
2 min
PR fusionados (30 d)
1

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de segmentio/analytics.js-integrations

Todos los issues de segmentio/analytics.js-integrations

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.