Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Pass the Page Title (or Slug) into a Hidden Field in a form


jontyh

Question

Site URL: https://jontyhurwitz.com

I have an enquiry form in the site footer.

When I get the enquiry through, I have no way of know which page it was submitted from.

I have created a hidden field in the form, and would like to pass the Page Title or the slug into this hidden form field.

You can see in this image, its the variable SQF_SLUG that I'd like to fill with the Page Title or the Page Slug.

Is it possible?  I can't find a way

 

 

222374764_Screenshot2020-10-19at16_20_06.thumb.png.0f9569460073e31ac4bbd9206aef9480.png

Link to post
  • Answers 2
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

Posted Images

2 answers to this question

Recommended Posts

  • 0

When tracking forms from different sources it is worth noting that you may have better transparency tracking origins through the use of separate forms each with their own unique name (i.e. Facebook Offer Form, Google Offer Form, etc.) Additionally you could consider sending the submissions from each form to a separate storage destination.

To specifically answer your question however using the hidden fields you will need to update the URL slug you want to track by adding the tracking code to the end of the slug.

/?SQF_<field-title>=<value>

There is a full article on how to implement this feature on available from Squarespace at https://support.squarespace.com/hc/en-us/articles/206543997-Tracking-Form-Block-referral-sources.

Link to post
  • 0

Thanks MoltoBello, yea I read that article, but that extracts from the URL.

In this case I'm not looking for the referrer.... I need the actual whole URL (or slug) of the page in the variable.

It seems to me there might be a way to do it by setting SQF_SLUG  variable in a code block.

<script>

SQF_SLUG = {Page-Title}

</script>

.... something like that.

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...