<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: jQuery to get page URL in hidden field in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/227627#M6523</link>
    <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hubspot.com/u/aaaaandrei"&gt;@aaaaandrei&lt;/A&gt;, that should work except with our form embed code you need to tack on the &lt;CODE&gt;.change()&lt;/CODE&gt; method. I made a quick example on my own page and was able to get the current location to populate the submission in a custom property called &lt;CODE&gt;URL&lt;/CODE&gt; that I had created. Here's what my code looks like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;$(document).ready(function(){
	var getURL = window.location;
  	$("input[name='url']").val(getURL).change();
});
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Your code should work, but again, it would be good to test this out on a live page -- I can't get to your URL that you linked above, as it says it's insecure for me.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Dec 2018 15:54:00 GMT</pubDate>
    <dc:creator>cbarley</dc:creator>
    <dc:date>2018-12-05T15:54:00Z</dc:date>
    <item>
      <title>jQuery to get page URL in hidden field</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/227624#M6520</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;My goal is to store the URL of the page the form is embedded on inside a contact property.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;So I built a form with a hidden field.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Embedded the form on the site so I can pick the field class(es) - hidden fields don't have an ID in HubSpot.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Wrote a bit of jQuery and tested it (on &lt;A href="https://jsfiddle.net/boilerplate/jquery" rel="nofollow noopener"&gt;https://jsfiddle.net/boilerplate/jquery&lt;/A&gt;)&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;See code:&lt;BR /&gt;
var getURL = window.location.href;&lt;BR /&gt;
&lt;SPAN class="math"&gt;('.hs_registration_backlink.hs-registration_backlink.hs-fieldtype-text.field.hs-form-field').val(&lt;/SPAN&gt;('.hs_registration_backlink.hs-registration_backlink.hs-fieldtype-text.field.hs-form-field').val()+getURL);&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I was then advised to add this before the closing body tag on the website.&lt;BR /&gt;
I haven't yet added this as I would have to go through our dev team to do that and I just wanted to make sure that the build is correct.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;The main question I have is - will the hidden field value then be stored inside the property value of the contacts who filled the form in?&lt;/STRONG&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Has anyone tried this before, is there anything to look out for?&lt;/P&gt;
&lt;P&gt;Thanks for taking the time to go through this.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 10:24:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/227624#M6520</guid>
      <dc:creator>Aaaaandrei</dc:creator>
      <dc:date>2018-12-04T10:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: jQuery to get page URL in hidden field</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/227625#M6521</link>
      <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hubspot.com/u/aaaaandrei"&gt;@aaaaandrei&lt;/A&gt;, happy to help! Are you just asking to see if your code should work on a page? What is the goal of this script?&lt;/P&gt;
&lt;P&gt;Can you please also send a link to the page you're working on so I can try to test some things out in the Console?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 21:51:30 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/227625#M6521</guid>
      <dc:creator>cbarley</dc:creator>
      <dc:date>2018-12-04T21:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: jQuery to get page URL in hidden field</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/227626#M6522</link>
      <description>&lt;P&gt;Thanks for the reply &lt;A class="mention" href="https://community.hubspot.com/u/connor_barley"&gt;@Connor_Barley&lt;/A&gt;!&lt;/P&gt;
&lt;P&gt;I tried the code on &lt;A href="https://jsfiddle.net/" rel="nofollow noopener"&gt;https://jsfiddle.net/&lt;/A&gt; so I know it works in that it prints the page URL inside a field. (see attachment).&lt;/P&gt;
&lt;P&gt;I'm more curious to confirm if that's all I need to store that value inside a contact property, and if there is a special place the code should go on the page (like above the HubSpot code for example).&lt;/P&gt;
&lt;P&gt;So the goal would be to store the page URL inside a contact property for automation purposes. The form is present on multiple location pages and I would want to create a workflows using the URL field as an enrollment criteria.&lt;/P&gt;
&lt;P&gt;Here's the URL for the page. The form pops up when you click on the green button: &lt;A href="https://ww1.qstopmba.com/events/qs-world-mba-tour/europe/st-petersburg" rel="nofollow noopener"&gt;https://ww1.qstopmba.com/events/qs-world-mba-tour/europe/st-petersburg&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Cheers.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;DIV class="lightbox-wrapper"&gt;&lt;A class="lightbox" href="https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/7/7d2dfc42897cdb2be9c3c298eca927e15bdb15ab.png" data-download-href="/legacyfs/online/uploads/default/7d2dfc42897cdb2be9c3c298eca927e15bdb15ab" title="Result.PNG" rel="nofollow noopener"&gt;&lt;IMG src="https://community.hubspot.com/legacyfs/online/uploads/default/optimized/2X/7/7d2dfc42897cdb2be9c3c298eca927e15bdb15ab_1_690x337.png" alt="Result" width="690" height="337" srcset="https://discourse-cdn-sjc1.com/hubspot/uploads/default/optimized/2X/7/7d2dfc42897cdb2be9c3c298eca927e15bdb15ab_1_690x337.png, https://discourse-cdn-sjc1.com/hubspot/uploads/default/optimized/2X/7/7d2dfc42897cdb2be9c3c298eca927e15bdb15ab_1_1035x505.png 1.5x, https://discourse-cdn-sjc1.com/hubspot/uploads/default/optimized/2X/7/7d2dfc42897cdb2be9c3c298eca927e15bdb15ab_1_1380x674.png 2x" /&gt;&lt;DIV class="meta"&gt;
&lt;SPAN class="filename"&gt;Result.PNG&lt;/SPAN&gt;&lt;SPAN class="informations"&gt;1920x940 49.5 KB&lt;/SPAN&gt;&lt;SPAN class="expand"&gt;&lt;/SPAN&gt;
&lt;/DIV&gt;&lt;/A&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 09:47:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/227626#M6522</guid>
      <dc:creator>Aaaaandrei</dc:creator>
      <dc:date>2018-12-05T09:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: jQuery to get page URL in hidden field</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/227627#M6523</link>
      <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hubspot.com/u/aaaaandrei"&gt;@aaaaandrei&lt;/A&gt;, that should work except with our form embed code you need to tack on the &lt;CODE&gt;.change()&lt;/CODE&gt; method. I made a quick example on my own page and was able to get the current location to populate the submission in a custom property called &lt;CODE&gt;URL&lt;/CODE&gt; that I had created. Here's what my code looks like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;$(document).ready(function(){
	var getURL = window.location;
  	$("input[name='url']").val(getURL).change();
});
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Your code should work, but again, it would be good to test this out on a live page -- I can't get to your URL that you linked above, as it says it's insecure for me.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 15:54:00 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/227627#M6523</guid>
      <dc:creator>cbarley</dc:creator>
      <dc:date>2018-12-05T15:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: jQuery to get page URL in hidden field</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/227628#M6524</link>
      <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hubspot.com/u/connor_barley"&gt;@Connor_Barley&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;So I ended up using the code recommended to us by our HS onboarding manager (the one mentioned in the description above) and I can confirm it fires but it doesn't pull the same data it did in my tests for some reason. If anything, it pulls much more data than expected. This is the value it added to the hidden field for my submission test:&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;{"rumScriptExecuteTime":6775.399999998626,"rumServiceResponseTime":7075.4999999917345,"rumFormRenderTime":1.1999999987892807,"rumTotalRenderTime":10517.299999992247,"rumTotalRequestTime":297.2999999910826,"lang":"en","renderRawHtml":"true","pageUrl":"https://ww1.qstopmba.com/events/qs-world-mba-tour/europe/st-petersburg","pageTitle":"World MBA Tour St. Petersburg TopMBA.com","source":"FormsNext-static-3.139","timestamp":1544523873001,"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","originalEmbedContext":{"portalId":"4668725","formId":"815284a8-4698-4b26-ad7b-26d27720147f","target":"#hbspt-form-1544523872855-1233246860","inlineMessage":true,"hutk":"dab4327b13fa0dc2ded837c4282adf98"},"formValidity":{"country":{"valid":true}},"formTarget":"#hbspt-form-1544523872855-1233246860","correlationId":"704c3575-7d60-4b7c-8c8c-42afeada880a","hutk":"dab4327b13fa0dc2ded837c4282adf98"}&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;When I checked HubSpot, the field was empty though. Do you know why HubSpot wouldn't be adding this data onto a contact property if it has been picked up in a (hidden) field?&lt;/P&gt;
&lt;P&gt;&lt;SPAN alt="" class="broken-image" title="This image is broken"&gt;&lt;SVG class="fa d-icon d-icon-unlink svg-icon" aria-hidden="true"&gt;&lt;USE href="#unlink"&gt;&lt;/USE&gt;&lt;/SVG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Wn the body as opposed to the header or footer, not sure if this would have anything to do with it but I thought I'd mention it.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://jira5.qsu-dev.com:8443/secure/attachment/138964/138964_script+in+body.PNG" rel="nofollow noopener"&gt;&lt;SPAN alt="" class="broken-image" title="This image is broken"&gt;&lt;SVG class="fa d-icon d-icon-unlink svg-icon" aria-hidden="true"&gt;&lt;USE href="#unlink"&gt;&lt;/USE&gt;&lt;/SVG&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://jira5.qsu-dev.com:8443/secure/attachment/138965/138965_code+shows+as+plain+text.PNG" rel="nofollow noopener"&gt;&lt;SPAN alt="" class="broken-image" title="This image is broken"&gt;&lt;SVG class="fa d-icon d-icon-unlink svg-icon" aria-hidden="true"&gt;&lt;USE href="#unlink"&gt;&lt;/USE&gt;&lt;/SVG&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Do you know why the code pulls more than just the URL? Equally important, why is this not present inside the contact property, once the form has been submitted?&lt;/P&gt;
&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 11:18:53 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/227628#M6524</guid>
      <dc:creator>Aaaaandrei</dc:creator>
      <dc:date>2018-12-11T11:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: jQuery to get page URL in hidden field</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/227629#M6525</link>
      <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hubspot.com/u/aaaaandrei"&gt;@aaaaandrei&lt;/A&gt;, not sure why that would happen, as I was able to get the current URL to populate with the code I used from my example when I placed it on my site. You shouldn't get all of that data unless there's another process, like a forms api call happening. I cannot see your screenshots, can you please send a link to the live site where you implemented this code?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 17:31:17 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/227629#M6525</guid>
      <dc:creator>cbarley</dc:creator>
      <dc:date>2018-12-11T17:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: jQuery to get page URL in hidden field</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/227630#M6526</link>
      <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hubspot.com/u/connor_barley"&gt;@Connor_Barley&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This is the link: &lt;A href="https://ww1.qstopmba.com/events/qs-world-mba-tour/europe/st-petersburg" rel="nofollow noopener"&gt;https://ww1.qstopmba.com/events/qs-world-mba-tour/europe/st-petersburg&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;It's a test website and as you pointed out, the browser may mark it as insecure. You should be able to access if you click advanced and then proceed anyway (in chrome).&lt;/P&gt;
&lt;P&gt;Let me know if you're able to access the page.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 09:25:32 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/227630#M6526</guid>
      <dc:creator>Aaaaandrei</dc:creator>
      <dc:date>2018-12-12T09:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: jQuery to get page URL in hidden field</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/227631#M6527</link>
      <description>&lt;P&gt;Hey &lt;A class="mention" href="https://community.hubspot.com/u/aaaaandrei"&gt;@aaaaandrei&lt;/A&gt;, thanks for the link — taking a look at your site, it looks like your code is not within a script tag and is just being rendered as a string.&lt;/P&gt;
&lt;ASIDE class="onebox whitelistedgeneric"&gt;
  &lt;HEADER class="source"&gt;
      &lt;IMG src="https://prntscr.com/favicon.ico" class="site-icon" width="32" height="32" /&gt;
      &lt;A href="https://prnt.sc/lu143j" target="_blank" rel="nofollow noopener"&gt;Lightshot&lt;/A&gt;
  &lt;/HEADER&gt;
  &lt;ARTICLE class="onebox-body"&gt;
    &lt;DIV class="aspect-image" style="--aspect-ratio:690/179;"&gt;&lt;IMG src="https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/7/7a0cc1ef3ce2c4014beaa6fc40ab37778ca6bc9f.png" class="thumbnail" /&gt;&lt;/DIV&gt;

&lt;H3&gt;&lt;A href="https://prnt.sc/lu143j" target="_blank" rel="nofollow noopener"&gt;Screenshot&lt;/A&gt;&lt;/H3&gt;

&lt;P&gt;Captured with Lightshot&lt;/P&gt;


  &lt;/ARTICLE&gt;
  &lt;DIV class="onebox-metadata"&gt;
    
    
  &lt;/DIV&gt;
  &lt;DIV style="clear: both"&gt;&lt;/DIV&gt;
&lt;/ASIDE&gt;

&lt;P&gt;You'll need to put that code within &lt;CODE&gt;&amp;lt;script&amp;gt;&amp;lt;/script&amp;gt;&lt;/CODE&gt; tags, or place your JS within the &lt;CODE&gt;onFormSubmit&lt;/CODE&gt; method within the form like so:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="lang-auto"&gt;&amp;lt;!--[if lte IE 8]&amp;gt;
&amp;lt;script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;![endif]--&amp;gt;
&amp;lt;script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script&amp;gt;
  hbspt.forms.create({
	portalId: "4668725",
	formId: "815284a8-4698-4b26-ad7b-26d27720147f",
    onFormSubmit: JS HERE
});
&amp;lt;/script&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Dec 2018 14:07:49 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/227631#M6527</guid>
      <dc:creator>cbarley</dc:creator>
      <dc:date>2018-12-12T14:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: jQuery to get page URL in hidden field</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/352014#M34532</link>
      <description>&lt;P&gt;CBARLEY - can you help me write a script to capture a Hubspot /Wordpress form page URL? I'm trying to capture the unique URL used to enter the info and then save that in the HubSpot.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jul 2020 16:14:53 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/352014#M34532</guid>
      <dc:creator>texasisheaven</dc:creator>
      <dc:date>2020-07-04T16:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: jQuery to get page URL in hidden field</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/669931#M55117</link>
      <description>&lt;P&gt;I had no luck will all above suggestions. I am using WordPress with the HubSpot plugin and finally got the following to pass the&amp;nbsp;current URL to a hidden form field successfully. Yay me!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;!-- [if lte IE 8]&amp;gt;&lt;BR /&gt;&amp;lt;script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;![endif]--&amp;gt;&lt;BR /&gt;&amp;lt;script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;hbspt.forms.create({&lt;BR /&gt;region: "na1",&lt;BR /&gt;portalId: "MYPORTALID",&lt;BR /&gt;formId: "MYFORMID",&lt;BR /&gt;css: '',&lt;BR /&gt;onFormReady: function($form) {&lt;BR /&gt;$form.find('input[name="MYFIELD_NAME"]').val(window.location.href).change();&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jul 2022 19:02:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/669931#M55117</guid>
      <dc:creator>JoelEckman</dc:creator>
      <dc:date>2022-07-23T19:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: jQuery to get page URL in hidden field</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/713824#M58406</link>
      <description>&lt;P&gt;I had to use this again and felt I should elaborate.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;Edit your hubspot form to include a hidden variable with an id such as page_url&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Replace the hubspot form shortcode in your wordpress site with the script above&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Change &lt;SPAN&gt;MYPORTALID&lt;/SPAN&gt; to your hubspot portal id&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Change&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;MYFORMID to your hubspot form (its the long string in the url when editing the form)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;SPAN&gt;Change the&amp;nbsp;MYFIELD_NAME to your hidden hubspot form property field id&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;SPAN&gt;Submit the new form from your website&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;SPAN&gt;Go to your zap in zapier&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;SPAN&gt;Make sure you are using the new connection method to hubspot and not the old email system&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;SPAN&gt;Walk through the setup for the zap and refresh form data. You should see your recent submission. Choose that data for testing.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;SPAN&gt;You may need to update your parsed email fields and you should now have the URL as a property variable&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;SPAN&gt;Sip Coffee and move on to next task... you are a hero.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Why would anyone need to do this?&amp;nbsp; Your client is too cheap to pay for the full version of HubSpot and they are too lazy to form a new email when they receive an inquiry and just want to hit reply on their notification.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 12:54:30 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/713824#M58406</guid>
      <dc:creator>JoelEckman</dc:creator>
      <dc:date>2022-11-03T12:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: jQuery to get page URL in hidden field</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/937897#M71645</link>
      <description>&lt;P&gt;I am not getting the desired result with the same code&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/11385"&gt;@cbarley&lt;/a&gt;&amp;nbsp;. However, I am testing the code on an external landing page created in Marketo right now. But this form will be hosted on multiple pages on WordPress in the future. So, I want the functionality to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset="utf-8"&amp;gt;
    &amp;lt;meta class="mktoString" mktoName="Variable 1" id="var1" default="This is a variable"&amp;gt;
    &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
    &amp;lt;style&amp;gt;
      body {background:#fff;} 
    &amp;lt;/style&amp;gt;
    

  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    ${var1}
    &amp;lt;div class="mktoText" id="exampleText" mktoName="Example Text Area"&amp;gt;
      Hubspot form to test JS Code
    &amp;lt;/div&amp;gt;
    &amp;lt;div&amp;gt;
  &amp;lt;!-- [if lte IE 8]&amp;gt;
&amp;lt;script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;![endif]--&amp;gt;
&amp;lt;script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script&amp;gt;
hbspt.forms.create({
region: "na1",
portalId: "MYPORTALID",
formId: "MYFORMID",
onFormReady: function($form) {
$form.find('input[name="content_download_page_url"]').val(window.location.href).change();
}
});
&amp;lt;/script&amp;gt;

    &amp;lt;/div&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 05 Mar 2024 13:34:09 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/jQuery-to-get-page-URL-in-hidden-field/m-p/937897#M71645</guid>
      <dc:creator>MKhanna4</dc:creator>
      <dc:date>2024-03-05T13:34:09Z</dc:date>
    </item>
  </channel>
</rss>

