# Finding Embed code for landing page

**URL:** <https://community.hubspot.com/t/finding-embed-code-for-landing-page/84542>\
**Category:** APIs & Integrations\
**Tags:** free\
**Created:** [July 2, 2023, 11:03pm UTC](https://community.hubspot.com/t/finding-embed-code-for-landing-page/84542 "2023-07-02T23:03:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SSmartminz](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@SSmartminz](https://community.hubspot.com/u/SSmartminz)\
**Post date:** [July 2, 2023, 11:03pm UTC](https://community.hubspot.com/t/finding-embed-code-for-landing-page/84542/1 "2023-07-02T23:03:02Z")

</div>

Hello all,

I’m new to hubspot. i’ve just created a landing page on hubspot and i want to embed on my website using an embed code but i have no idea where to get it, please your help will be appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![PMcConnell](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pmcconnell/32/82468_2.png) [@PMcConnell](https://community.hubspot.com/u/PMcConnell)\
**Post date:** [July 3, 2023, 5:42am UTC](https://community.hubspot.com/t/finding-embed-code-for-landing-page/84542/2 "2023-07-03T05:42:55Z")

</div>

Hi @SSmartminz ,

Nice to e-meet you !

I am a Software Engineer at Baskey and will be happy to help you with this.

I would recommend using an iframe to embed the landing page. You just need to insert the landing page url into the example below and then use it on your site. You can then set the width and height to style it.

`<iframe src="https://hubspot-sites.com/landing-page" height="600" width="1400" title="Iframe Example"></iframe>`

If you need any more help with this, feel free to contact me.  
Best regards,  
Pauric  
email: [p.mcconnell@baskey.eu](mailto:p.mcconnell@baskey.eu)  
linkedIn: [https://www.linkedin.com/in/pauric-mc-connell/](https://www.linkedin.com/in/pauric-mc-connell/)

---

<div class="post-metadata">

**Author:** ![EKnechtges](https://avatars.discourse-cdn.com/v4/letter/e/8e8cbc/32.png) [@EKnechtges](https://community.hubspot.com/u/EKnechtges)\
**Post date:** [October 17, 2023, 8:34pm UTC](https://community.hubspot.com/t/finding-embed-code-for-landing-page/84542/3 "2023-10-17T20:34:57Z")

</div>

Pauric,  
Thank you for this! Do you know of any way to get the height value from the hubspot page itself? I can embed with an iframe, but if the height of the iframe element and the height of the hubspot page don’t match, there will either be a scrollbar or a long margin at the bottom. I can’t seem to figure out a way to read the height of the iframe dynamically.

---

<div class="post-metadata">

**Author:** ![PMcConnell](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pmcconnell/32/82468_2.png) [@PMcConnell](https://community.hubspot.com/u/PMcConnell)\
**Post date:** [October 19, 2023, 9:10am UTC](https://community.hubspot.com/t/finding-embed-code-for-landing-page/84542/4 "2023-10-19T09:10:01Z")

</div>

Hi @EKnechtges  
I believe the following may help with this.

```lia-code-sample
window.addEventListener('DOMContentLoaded', (event) => {
 var iframe = document.getElementById('your-iframe-id');
 iframe.onload = function () {
 iframe.style.height = iframe.contentWindow.document.body.scrollHeight + 'px';
 };
});

```

Replace ‘your-iframe-id’ with the actual ID of your iframe. This script will set the iframe height to match the content height once the iframe has fully loaded.  
Let me know if you need anything else,  
Pauric
