{"id":308,"date":"2025-04-25T23:16:53","date_gmt":"2025-04-25T23:16:53","guid":{"rendered":"http:\/\/www.soapandseife.com\/?p=308"},"modified":"2025-04-26T23:25:08","modified_gmt":"2025-04-26T23:25:08","slug":"form-submission-with-cross-domain-url-redirect-how-to-add-query-string-params","status":"publish","type":"post","link":"http:\/\/www.soapandseife.com\/index.php\/2025\/04\/25\/form-submission-with-cross-domain-url-redirect-how-to-add-query-string-params\/","title":{"rendered":"Form submission with cross-domain URL redirect – how to add query string params"},"content":{"rendered":"

We’re embedding a HubSpot form on our primary company website.<\/P>

When a user finishes completing the form, we redirect them to an external URL for another site that we own (this is one of the native HubSpot options when configuring form submissions). The target site is on a completely different domain.<\/P>

 <\/P>

Both sites use the same HubSpot tracking code.<\/P>

 <\/P>

In the above scenario, we’re losing context (Activity tracking) of the contact because of cross-domain cookie issues.<\/P>

 <\/P>

So, we’d like to add the appropriate query string params to the target URL such that the tracking code will pick up the contact and continue tracking their activity on the other domain.<\/P>

 <\/P>

Is there a way to have HubSpot dynamically add the correct query string parameters before redirecting the user to the external URL? I’m thinking something along these lines when specifying the URL:<\/P>

 <\/P>

https:\/\/<target <\/a>domain>\/landing_page?__hstc=%HSTC_CODE%<\/P>

 <\/P>

I know we can do some of this via JavaScript (as specified here – https:\/\/developers.hubspot.com\/docs\/reference\/api\/analytics-and-events\/tracking-code#get-cross-domain-linking-parameters<\/a>) but we’re really trying to do this without code.<\/P>

 <\/P>

Any guidance would be much appreciated.<\/P>

 <\/P><\/p>\n","protected":false},"excerpt":{"rendered":"

We’re embedding a HubSpot form on our primary company website.When a user finishes completing the form, we redirect them to an external URL for another site that we own (this is one of the native HubSpot options when configuring form submissions). The target site is on a completely different domain. Both sites use the same HubSpot…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"http:\/\/www.soapandseife.com\/index.php\/wp-json\/wp\/v2\/posts\/308"}],"collection":[{"href":"http:\/\/www.soapandseife.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.soapandseife.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.soapandseife.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.soapandseife.com\/index.php\/wp-json\/wp\/v2\/comments?post=308"}],"version-history":[{"count":1,"href":"http:\/\/www.soapandseife.com\/index.php\/wp-json\/wp\/v2\/posts\/308\/revisions"}],"predecessor-version":[{"id":309,"href":"http:\/\/www.soapandseife.com\/index.php\/wp-json\/wp\/v2\/posts\/308\/revisions\/309"}],"wp:attachment":[{"href":"http:\/\/www.soapandseife.com\/index.php\/wp-json\/wp\/v2\/media?parent=308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.soapandseife.com\/index.php\/wp-json\/wp\/v2\/categories?post=308"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.soapandseife.com\/index.php\/wp-json\/wp\/v2\/tags?post=308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}