CMS Development

Simon_Goldie
Participant

Display form submission stats on a landing page

I'm creating a set of internal landing pages and one of the items I'd really like to include for the sales teams is how many form submissions have been submitted on the page.

 

Just to expand on it a little, I'll have a form on the page that is always available and that includes all the contact details, as well as a dropdown to assign it to a specific campaign.  The sales teams have a target for submitting X opportunities for each quarter, so it would be nice to be able to show how many have been done.

 

Anyone know if this is possible?

0 Upvotes
2 Replies 2
tjoyce
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Display form submission stats on a landing page

I'm going to respond with a super-hackish, probably unreliable but, all around fun approach to what you're asking. Then i'll let someone else chime in with a potential API or HUBdb solution 😄

 

  1. Create another form field in your form called count
  2. in your embed code, use the onFormSubmit callback to increase that value by 1 every time the form is submitted
    onFormSubmit: function($form){
        var $field = $form.find('input[name="count"]');
        var fieldval = $field.val();
        var newFieldVal = fieldVal+1;
        $field.val(newFieldVal);
    }
  3. use onFormReady to present that number somwhere else in the DOM
    onFormReady: function($form){
        var submissionCount = $form.find('input[name="count"]').val();
        // copy this value to another DOM element
        $('body').prepend(submissionCount + " forms have been submitted");
    }

Like I said, super-hackish and unreliable but if you're looking for close enough and easy, well, there it is.

Kicker, If a user sits on the page all day and then decides to submit the form 8 hours later after maybe 20 other users have submitted, the number will probably be overridden by that stale user's form submission.


If this answer helped, please, mark as solved 😄


tim@belch.io | forms.belch.io | Design your own Beautiful HubSpot Forms; No coding necessary.

 

Drop by and say Hi to me on slack.

0 Upvotes
Simon_Goldie
Participant

Display form submission stats on a landing page

Thanks for the response, I always appreciate any feedback, though it's just not the reliable solution I'm after. 

 

I'm hoping this can be done via HUBL or API calls.