APIs & Integrations

OYeni
Participant

Create Update Contact via Google GTM

SOLVE

There are datalayers I need to read on my site, and I want to create a user with these datalayers, emails,first name, last name etc.

How can I do this with Google Tag Manager

0 Upvotes
1 Accepted solution
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

Create Update Contact via Google GTM

SOLVE

Hey @OYeni 

So at a high level you could add custom Javascript to GTM that hits an webhook endpoint or form API with the layer data. This could materialize in many ways, so I would need to know more about your case to suugest a more concrete solution.

 

If you need assistance or have any other questions please dont hesistate to reach out.

Kevin Cornett - Sr. Solutions Architect @ BridgeRev

View solution in original post

0 Upvotes
3 Replies 3
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

Create Update Contact via Google GTM

SOLVE

Hey @OYeni 

So at a high level you could add custom Javascript to GTM that hits an webhook endpoint or form API with the layer data. This could materialize in many ways, so I would need to know more about your case to suugest a more concrete solution.

 

If you need assistance or have any other questions please dont hesistate to reach out.

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
0 Upvotes
HMir
Member

Create Update Contact via Google GTM

SOLVE

@OYeni wrote:

There are datalayers I need to read on my site, and I want to create a user with these datalayers, emails,first name, last name etc.

How can I do this with Google Tag Manager


You'll need to set up tags and triggers that read the data layer variables and send them to your desired endpoint, such as a CRM system. First, ensure your data layer is correctly set up on your website and contains the necessary information, such as email, first name, and last name. An example data layer might look like this:
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'userData',
'userEmail': 'user@example.com',
'firstName': 'John',
'lastName': 'Doe'
});

Next, create Data Layer Variables in GTM. Go to GTM and navigate to your workspace, then click on Variables on the left sidebar. Create a new User-Defined Variable for each piece of data you need to capture. Click on "New," select "Data Layer Variable," and name the variable (e.g., DLV - User Email). Set the Data Layer Variable Name to match the key in your data layer (e.g., userEmail). Repeat this process for all necessary data points like first name and last name.

Finally, create a tag to send this data to your CRM. Go to the Tags section, click on "New," and configure a tag based on the method required by your CRM (e.g., HTTP Request, Custom HTML, etc.). Include the variables you've set up in the tag's configuration. Set up a trigger to fire the tag based on your data layer event (e.g., userData). Save and publish your container.



0 Upvotes
OYeni
Participant

Create Update Contact via Google GTM

SOLVE

I'm just stuck on the last part, there is no problem with datalayer readings.
I just don't know How to send data with GTM to HUBSPOT

0 Upvotes