=== Measured Bid ===
Contributors: verlua
Tags: quote, estimate, calculator, contractor, lead generation
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add your Measured Bid instant quote widget to any page. Homeowners enter an address and see a price range built from your rates.

== Description ==

Measured Bid is estimating software for exterior contractors: gutters and gutter guards, exterior painting, siding, roofing, permanent lighting, Christmas lights and pressure washing. This plugin puts your Measured Bid widget on a WordPress page with one shortcode.

On the page, a homeowner types their address and confirms their house on an aerial image. They answer a few questions about the job. The widget measures the house from aerial roof data and shows a price range built from the rates you set in Measured Bid. When they send their name and phone number, the lead goes to your Measured Bid dashboard with the measurements, the range they saw and their answers.

What the plugin does:

* Adds the `[instant_quote]` shortcode, which outputs the widget in an iframe.
* Resizes the iframe to fit the widget, so there is no inner scroll bar.
* Passes the page's `utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content`, `gclid`, `gbraid`, `wbraid`, `fbclid` and `msclkid` parameters and the page address into the widget, so each lead shows where it came from.
* Pushes each widget step to `window.dataLayer` as `{ event: "iq_step", step, brand }` for Google Tag Manager and GA4.
* Scrolls the widget back into view on each new step if the visitor has scrolled past its top.

You need a Measured Bid account to use this plugin. New accounts start with a free trial and no card. Plans and prices: https://measuredbid.com/pricing

== Installation ==

1. In WordPress, go to Plugins → Add Plugin (Add New on older versions) and click Upload Plugin. Choose the zip file, click Install Now, then activate the plugin.
2. Go to Settings → Measured Bid. Set the App URL to https://measuredbid.com. You can instead define `IQ_APP_URL` in wp-config.php.
3. In Measured Bid, open your widget's settings and add this website under Websites. Add both the www and non-www addresses if your site uses both. On any site that isn't listed, the widget stays blank.
4. Copy the shortcode from your widget's Install page in Measured Bid and paste it into any page, for example `[instant_quote brand="your-widget-id"]`.

Shortcode options:

* `brand` is your widget's ID. You can skip it if you set a default brand under Settings → Measured Bid.
* `title` is the iframe title that screen readers announce. The default is "Instant price".
* `min_height` is the starting height in pixels before the widget reports its size. The default is 640 and the smallest allowed is 320.

== Frequently Asked Questions ==

= The widget is blank. What do I check? =

Add your website under Websites in your widget's settings in Measured Bid. The widget only loads on sites listed there. Then check that the App URL in Settings → Measured Bid is https://measuredbid.com.

= Can I put more than one widget on a page? =

Yes. Each shortcode gets its own iframe, and one script on the page resizes each of them.

= Do homeowners see the Measured Bid name? =

No. The widget shows your company name and colors.

= Where do the leads go? =

To your Measured Bid dashboard. You can also send each lead to your email and to a webhook for Zapier, GoHighLevel or another CRM. Set these up in your widget's settings in Measured Bid.

= Does it work with page builders? =

It works anywhere WordPress runs shortcodes, such as the Shortcode block in the block editor. Most page builders have a shortcode element too.

== External services ==

This plugin embeds the Measured Bid widget, a service run by Verlua. The widget loads in an iframe from the App URL you set (https://measuredbid.com). Nothing loads until you set the App URL and a widget ID.

What is sent, and when:

* When a visitor opens a page with the shortcode, their browser loads the widget from the App URL. The iframe address includes your widget ID, the page's address and any of these parameters in the page's own address: utm_source, utm_medium, utm_campaign, utm_term, utm_content, gclid, gbraid, wbraid, fbclid and msclkid.
* When a visitor uses the widget, the address they type, the answers they give and, if they send the form, their name, phone number, optional email, preferred visit time and text-message consent go to Measured Bid. Measured Bid uses Google Maps Platform to look up and measure the address.
* The plugin itself stores two settings in your WordPress database: the App URL and the default widget ID. It sets no cookies.

Terms of service: https://measuredbid.com/terms
Privacy policy: https://measuredbid.com/privacy

== Changelog ==

= 1.1.2 =
* Validate widget message types and brands, ignore repeated steps, and respect reduced motion when scrolling.

= 1.1.1 =
* After the first step the widget's frame follows its own height, so the thank-you screen leaves no blank space under it.

= 1.1.0 =
* Add a service attribute to open one trade on a multi-trade widget.

= 1.0.1 =
* Licensed under GPLv2 or later.
* Added this readme in the WordPress.org format.
* Settings help now points to the Websites list in Measured Bid.
* Internal function names now use the measuredbid_ prefix. The shortcode, settings and IQ_APP_URL constant are unchanged.

= 1.0.0 =
* First release: the [instant_quote] shortcode, iframe resizing, UTM and click ID pass-through, and dataLayer step events.

== Upgrade Notice ==

= 1.1.2 =
More precise widget event validation and reduced-motion scrolling. No settings change.

= 1.1.1 =
No blank space under the widget after a homeowner books. No settings change.

= 1.1.0 =
Use service="roofing" to skip the service picker on a roofing page.

= 1.0.1 =
License and readme update. No changes to the shortcode or settings.
