跳至主要內容
WordPress.org

Taiwan 正體中文

  • 佈景主題目錄
  • 外掛目錄
  • 最新消息
  • 技術支援
  • 關於我們
  • 團隊
  • 取得 WordPress
取得 WordPress
WordPress.org

Plugin Directory

Mercury – Auto Height for Pardot Forms

  • 提交外掛
  • 我的最愛
  • 登入
  • 提交外掛
  • 我的最愛
  • 登入

Mercury – Auto Height for Pardot Forms

由 pragmasoftwares 開發
下載
  • 詳細資料
  • 使用者評論
  • 安裝方式
  • 開發資訊
技術支援

外掛說明

Important: this plugin, on its own, cannot make forms auto-height. A browser will not let one domain read the content of an iframe from another domain, and this is not really a limitation of Pardot, WordPress, or this plugin, it is simply the same-origin policy that every browser enforces. Auto-height works only once a small companion script (generated for you, please see Installation below) has also been added to your Pardot Form Layout Template. If that step is skipped, this plugin has nothing to listen for, and forms will simply keep their normal height.

Marketing Cloud Account Engagement forms, still widely known by their original product name, Pardot, are usually embedded on external sites inside a fixed-height iframe. Since the form itself lives on a different domain, the parent page genuinely has no way of knowing its real content height, so tall forms get clipped, and shorter forms leave behind empty space or an unnecessary scrollbar.

Mercury addresses this with a small, two-part messaging mechanism:

  1. A short script, generated by this plugin for your own domain, is added once to your Pardot Form Layout Template’s header. It measures the actual rendered height of the Pardot form page and reports it to the parent window whenever it changes, on load, on window resize, and whenever validation errors expand the form.
  2. This plugin listens for that message on your WordPress site and applies the reported height, plus an optional buffer, to the matching iframe.

Requirements

  • A Pardot or Account Engagement account with access to edit Form Layout Templates.
  • The exact tracker (“go.”) domain your Pardot forms are served from, entered once on this plugin’s settings screen.

What this plugin does not do

  • It does not create, host, or modify Pardot forms.
  • It does nothing until the generated code snippet has also been added to your Pardot Form Layout Template. The settings screen explains this and includes a checkbox so you can keep track of whether that step is done.

Privacy

This plugin makes no external HTTP requests and does not collect any data. The only communication involved is a postMessage between the Pardot iframe and the parent page, two pages you already control, carrying nothing more than a height in pixels and a form ID parsed from the form’s own URL.

螢幕擷圖

The settings form: enable auto-height, set the trusted Pardot domain and buffer, and confirm the Pardot-side code once it is in place.
The settings form: enable auto-height, set the trusted Pardot domain and buffer, and confirm the Pardot-side code once it is in place.
Once saved, the how-it-works steps and the generated code block, ready to copy into your Pardot Form Layout Template.
Once saved, the how-it-works steps and the generated code block, ready to copy into your Pardot Form Layout Template.

安裝方式

  1. Install and activate the plugin through the “Plugins” screen in WordPress, or upload the plugin folder to /wp-content/plugins/.
  2. Go to Settings → Pardot Auto Height.
  3. Tick Enable auto-height.
  4. Enter your Trusted Pardot domain, the “go.” tracker domain your forms are served from (for example https://go.example.com).
  5. Leave Extra height buffer at its default of 200px, or adjust it as needed. This is the amount we would generally recommend, mainly to prevent a scrollbar flash when a form expands to show validation errors.
  6. Copy the generated code block into your Pardot account, under Marketing → Forms → Layout Templates, into the Header section of the layout template your embedded forms use.
  7. Once that code is live on the Pardot side, tick Pardot code added to confirm, then save.
  8. If auto-height does not seem to be applying, kindly tick Enable debug logging, save, then open a page with an embedded form and check your browser console. Please see the FAQ below for what to look for.

常見問題集

Why do I need to add code to Pardot as well as installing this plugin?

A page cannot see into an iframe from a different domain, as per the browser’s own same-origin policy, and this is not a limitation of Pardot or WordPress. The Pardot-side code is what tells the parent page how tall the form actually is, and this plugin is what listens for that and resizes the iframe. Both halves are genuinely required for this to work.

Where do I find my “Trusted Pardot domain”?

This is the domain your Pardot forms load from in the browser address bar when you open a form directly, typically your Pardot account’s own tracker domain, for example https://go.yourcompany.com.

Does this work with multiple forms on the same page?

Yes. Each form reports its own height along with an ID parsed from its own URL, and the plugin matches that ID against the src of each iframe on the page. If only one matching iframe is present and no ID is available, that single iframe is used.

Does this send any data externally?

No, it does not. Please see the Privacy section above.

What if I have not added the Pardot-side code yet?

The plugin’s settings screen shows a warning while auto-height is enabled but not yet confirmed. Nothing breaks in the meantime, forms simply keep their default height until the Pardot-side code is actually added.

Auto-height does not seem to be working, how do I debug it?

Kindly tick Enable debug logging on the settings screen, save, then open a page that has an embedded form on it and check your browser console. There is no need to wait around or keep refreshing, since this gives an instant answer either way:

  • If you see a received height= line in the console, everything is working as expected.
  • If there is no such line, the code has generally not reached the Pardot side yet. It would be worth rechecking that it is in the correct Layout Template, that it has been saved, and that it is actually used by the form you are testing.

This setting can only be switched on by an admin from the settings screen. There is deliberately no URL trigger for it, so a visitor cannot turn on debug logging without your approval.

What happens to my settings if I uninstall the plugin?

By default, nothing. Deleting the plugin leaves your saved settings in place, so if you install it again later, everything comes back exactly as it was. If you would genuinely like every setting removed for good, kindly tick Delete all plugin data on uninstall on the settings screen first, this is off by default and needs to be turned on deliberately.

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈Mercury – Auto Height for Pardot Forms〉的開發相關工作。

參與者
  • pragmasoftwares

將〈Mercury – Auto Height for Pardot Forms〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄。

變更記錄

1.0.0

  • Initial release.

中繼資料

  • 版本 1.0.0
  • 最後更新 2 天前
  • 啟用安裝數 少於 10 次
  • WordPress 版本需求 6.0 或更新版本
  • 已測試相容的 WordPress 版本 7.1
  • PHP 版本需求 7.4 或更新版本
  • 語言
    English (US)
  • 標籤:
    account engagementformsiframePardotsalesforce
  • 進階檢視

評分

這個項目尚無任何評論記錄。

撰寫評分

查看全部使用者評論

參與者

  • pragmasoftwares

技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

檢視技術支援論壇

  • 關於我們
  • 最新消息
  • 主機代管
  • 隱私權
  • 展示網站
  • 佈景主題目錄
  • 外掛目錄
  • 區塊版面配置目錄
  • Learn
  • 技術支援
  • 開發者資源
  • WordPress.tv ↗
  • 共同參與
  • 活動
  • 贊助基金會 ↗
  • Swag ↗
  • WordPress.com ↗
  • Matt ↗
  • bbPress ↗
  • BuddyPress ↗
WordPress.org
WordPress.org

Taiwan 正體中文

  • 查看我們的 X (之前的 Twitter) 帳號
  • 造訪我們的 Bluesky 帳號
  • 造訪我們的 Mastodon 帳號
  • 造訪我們的 Threads 帳號
  • 造訪我們的 Facebook 粉絲專頁
  • Visit our Instagram account
  • Visit our LinkedIn account
  • 造訪我們的 TikTok 帳號
  • Visit our YouTube channel
  • 造訪我們的 Tumblr 帳號
程式碼,如詩
The WordPress® trademark is the intellectual property of the WordPress Foundation.