CMS Development

narmstrong
Contributor | Platinum Partner
Contributor | Platinum Partner

Form Showing TYP URL in Source

It seems like Hubspot forms show the "redirectUrl" in the source code.

Is there a way to not display the typ or redirect page in the options object?

Seems like a very large shortcomming if not.

This seems to show up for any user permission or a visitor that is not logged into Hubspot.

 

<script>
        var options = {
            formsBaseUrl: '/_hcms/forms/',
            portalId: 'portalid',
            formId: 'formid',
            formInstanceId: 'instanceid',
            pageId: 'pageid',

            pageName: "Request a Proposal for Managed IT Services  | Maryland IT Solutions",
            redirectUrl: "https:\/\/www.example.com\/conversion-pages\/thank-you-request-a-managed-services-proposal",

            css: '',
            target: '#hs_form_target_widget_1554752276848',

            contentType: "standard-page",
            
            formData: {
                cssClass: 'hs-form stacked hs-custom-form'
            }
        };

        options.getExtraMetaDataBeforeSubmit = function() {
            var metadata = {};
            

            if (hbspt.targetedContentMetadata) {
                var count = hbspt.targetedContentMetadata.length;
                var targetedContentData = [];
                for (var i = 0; i < count; i++) {
                    var tc = hbspt.targetedContentMetadata[i];
                     if ( tc.length !== 3) {
                        continue;
                     }
                     targetedContentData.push({
                        definitionId: tc[0],
                        criterionId: tc[1],
                        smartTypeId: tc[2]
                     });
                }
                metadata["targetedContentMetadata"] = JSON.stringify(targetedContentData);
            }

            return metadata;
        };
        hbspt.forms.create(options);
    </script>
Noah Armstrong | TSL Marketing
Senior Developer
6085 Marshalee Dr| Suite 100 | Elkridge, MD 21075
Contact Us

TSL Marketing
0 Upvotes
1 Reply 1
narmstrong
Contributor | Platinum Partner
Contributor | Platinum Partner

Form Showing TYP URL in Source

So noone has seen this or thinks this is an issue? I mean gating content is a pretty regular practice. Hiding the options in a server file is a pretty regular practice as well. I understand if you have to embed it,  but this is both in the embed and in the onsite modules.

Noah Armstrong | TSL Marketing
Senior Developer
6085 Marshalee Dr| Suite 100 | Elkridge, MD 21075
Contact Us

TSL Marketing
0 Upvotes