Reporting & Analytics

ilporyynanen
メンバー

Populating datalayer variables with page data

解決

Hi everyone,

 

I am trying to populate datalayer variables in thank you page template with page data. I have already managed to do so with contact properties like this:

 

<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event' : 'formSubmissionSuccess',
'contactId' : {{contact.id}}
});
</script>

 

But I have not managed to include data from the page itself. I would wish it to be something like this:

<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event' : 'formSubmissionSuccess',
'pageTitle' : {{page title here}},

'pageUrl': {{page url here}}

});
</script>

Also any other page related data would be great.

 

Also I would be interested in passing data to the datalayer with the form values when a form has been submitted and assuing the next page would be thank you page where we could use and send data to various platforms.

 

Are there ready-made variables in Hubspot which I could use or does this require custom coding?

Thank you for your time,

Ilpo Ryynänen

0 いいね!
1件の承認済みベストアンサー
Kevin-C
解決策
名誉エキスパート | Solutions Partner
名誉エキスパート | Solutions Partner

Populating datalayer variables with page data

解決

Thanks @sharonlicari 

 

Hey @ilporyynanen 

 

This documentation has the hubl variables for your all accessible current page data.

 

For page URL use "request.full_url" and for the title use "page_meta.html_title"

 

Hope this gets you moving

Kevin Cornett - Sr. Solutions Architect @ BridgeRev

元の投稿で解決策を見る

2件の返信
sharonlicari
コミュニティーマネージャー
コミュニティーマネージャー

Populating datalayer variables with page data

解決

Hey @ilporyynanen 

 

Thank you for sharing this information. I'll tag a few experts that can share their experiences with you.

 

Hey @Kevin-C @Aakar @Joe-Kelp any tip or advice you can share with @ilporyynanen?

 

Thank you

Sharon


Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success.
Don't miss this opportunity to connect and grow—reserve your spot today!

0 いいね!
Kevin-C
解決策
名誉エキスパート | Solutions Partner
名誉エキスパート | Solutions Partner

Populating datalayer variables with page data

解決

Thanks @sharonlicari 

 

Hey @ilporyynanen 

 

This documentation has the hubl variables for your all accessible current page data.

 

For page URL use "request.full_url" and for the title use "page_meta.html_title"

 

Hope this gets you moving

Kevin Cornett - Sr. Solutions Architect @ BridgeRev