Lead Capture Tools

ASCK
Member

Wordpress Shortcode Forms while capturing page data

SOLVE

We are using WooCommerce and we have product pages IE: Elevator, or Chairlift so on. If a user lands on the Elevator product we want to give them the opportunity to talk to sales rep, We have integrated a hubspot form on the product page using a wordpress hubspot shortcode.

Here is are issue unless we explicity ask them in the form, and we don't want to ask them the price the product so on to save them time, how does the sales rep know what product they were looking at?

Is there anyway to capture the information from the page and have it sent with the form submission, at the very least the URL so the sales rep could click on the url and see what product they were looking at.

Kindly,

0 Upvotes
1 Accepted solution
Ben_M
Solution
Key Advisor

Wordpress Shortcode Forms while capturing page data

SOLVE

You will probably do this in a more programmatic way then to simply set the numbers manually per page. So for instance in the onFormReady or onFormSubmit functions you could run something like:

 

    onFormReady: function($form){
    	$('input[name="productname"]').val('Elevator').change();   
   	}

 

The function you choose will depend on whether the information is known to the system when the form generates or whether it will be passed to the form via the page after the user makes choices. 

View solution in original post

0 Upvotes
3 Replies 3
Ben_M
Key Advisor

Wordpress Shortcode Forms while capturing page data

SOLVE

Sure. You can pass values to hidden form fields. I don't know whether it can be done via the shortcode, but it can definitely be done by customizing the standard form embed code ( https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options ).

0 Upvotes
ASCK
Member

Wordpress Shortcode Forms while capturing page data

SOLVE

Looking at this makes sense to me. However if this is my hubspot form

 

```

hbspt.forms.create({
region: "na1",
portalId: "redacted",
formId: "redacted"
});

```

 

How do I add hidden fields, and how do those hidden fields show up in hubspot. Do I just do something like this?

 

```

hbspt.forms.create({
region: "na1",
portalId: "redacted",
formId: "redacted",

productName: "Elevator",

productPrice: $120,000
});

```

Or is there a more specific way to do hidden fields themselves?

0 Upvotes
Ben_M
Solution
Key Advisor

Wordpress Shortcode Forms while capturing page data

SOLVE

You will probably do this in a more programmatic way then to simply set the numbers manually per page. So for instance in the onFormReady or onFormSubmit functions you could run something like:

 

    onFormReady: function($form){
    	$('input[name="productname"]').val('Elevator').change();   
   	}

 

The function you choose will depend on whether the information is known to the system when the form generates or whether it will be passed to the form via the page after the user makes choices. 

0 Upvotes