# Bringing Google Tag Manager's data layer variables into HubSpot

**URL:** <https://community.hubspot.com/t/bringing-google-tag-managers-data-layer-variables-into-hubspot/36683>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [May 4, 2021, 5:21pm UTC](https://community.hubspot.com/t/bringing-google-tag-managers-data-layer-variables-into-hubspot/36683 "2021-05-04T17:21:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![LChiappini](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/lchiappini/32/39532_2.png) [@LChiappini](https://community.hubspot.com/u/LChiappini)\
**Post date:** [May 4, 2021, 5:21pm UTC](https://community.hubspot.com/t/bringing-google-tag-managers-data-layer-variables-into-hubspot/36683/1 "2021-05-04T17:21:45Z")

</div>

Hi all!

We are using Google Tag Manager on our website’s acquisition funnel in order to bring some data into Google Analytics.

I’m wondering: can I bring these variables also inside defined HubSpot’s custom properties?

For example:

- user A begings the onboarding funnel

- I have “procedureId” both on HubSpot’s contact and in data layer on website: maybe I can use this one to match the user and bring other data in? i.e. gclid, amount request, etc

Many thanks!

Luca

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [May 5, 2021, 3:06pm UTC](https://community.hubspot.com/t/bringing-google-tag-managers-data-layer-variables-into-hubspot/36683/2 "2021-05-05T15:06:31Z")

</div>

@Josh , @Kevin-C can either of you offer some tips here?

---

<div class="post-metadata">

**Author:** ![LChiappini](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/lchiappini/32/39532_2.png) [@LChiappini](https://community.hubspot.com/u/LChiappini)\
**Post date:** [May 7, 2021, 9:54am UTC](https://community.hubspot.com/t/bringing-google-tag-managers-data-layer-variables-into-hubspot/36683/3 "2021-05-07T09:54:15Z")

</div>

Hi guys, do you have any clues for me? 🙂

---

<div class="post-metadata">

**Author:** ![Josh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/josh/32/17115_2.png) [@Josh](https://community.hubspot.com/u/Josh)\
**Post date:** [May 7, 2021, 12:50pm UTC](https://community.hubspot.com/t/bringing-google-tag-managers-data-layer-variables-into-hubspot/36683/4 "2021-05-07T12:50:32Z")

</div>

Hi @LChiappini,

I haven’t attempted exactly what you’re looking to do, but would a webhook work?

Thanks for the ping @dennisedson

---

<div class="post-metadata">

**Author:** ![LChiappini](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/lchiappini/32/39532_2.png) [@LChiappini](https://community.hubspot.com/u/LChiappini)\
**Post date:** [May 7, 2021, 12:51pm UTC](https://community.hubspot.com/t/bringing-google-tag-managers-data-layer-variables-into-hubspot/36683/5 "2021-05-07T12:51:31Z")

</div>

How can I use a webhook in this way?

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [May 11, 2021, 8:25am UTC](https://community.hubspot.com/t/bringing-google-tag-managers-data-layer-variables-into-hubspot/36683/6 "2021-05-11T08:25:48Z")

</div>

Hi @LChiappini ,

- You can’t add json / embed code into the custom properties.  
-If you want to add code via api then try with this JSON.stringify(“{‘id’:‘123’, ‘age’ : 10}”)  
Or  
GTM manager event :  
window.HubSpotConversations.on(‘conversationStarted’, payload =\> {  
dataLayer.push({‘event’: ‘hs\_chat\_started’});  
});  
Hope this helps!  
If we were able to answer your query, kindly help the community by marking it as a solution.  
Thanks and Regards.

---

<div class="post-metadata">

**Author:** ![Danylo](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/danylo/32/43872_2.png) [@Danylo](https://community.hubspot.com/u/Danylo)\
**Post date:** [September 30, 2021, 12:34pm UTC](https://community.hubspot.com/t/bringing-google-tag-managers-data-layer-variables-into-hubspot/36683/7 "2021-09-30T12:34:50Z")

</div>

Hey there. We use our own developement - Google Tag Manager tag to track all the needed data and inject them into the non Hubspot form hidden fields (to be still tracked by HubSpot). Btw, if you want to track offline conversions/sales, than GA CID is by far not a single parameter you need to send to GA in order to bypass its filter as well as to send a correct IP (geo) or not a server, but a user.
