Skip to content

google-tag-manager add identify properties to dataLayer #693

@ls-jacob-lawrence

Description

@ls-jacob-lawrence

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions