When you embed your inquiry form or the initial application form on a page in your school's website, you can use javascript to track new inquiries and application starts.
New Inquiries
- The inquiry iframe sends the message
inquiry.submitted
to the parent page when an inquiry submits the form. - Your Javascript can then trigger an event when one of those messages is received.
To listen for these messages, you'll need Javascript code on your container page along these lines:
window.addEventListener('message',function(message){ if(message.data.type == 'populi.inquiry.submitted'){ alert('Do it!'); } });
Application Starts
- The application iframe sends the message
application.start
to the parent page when an applicant submits the initial form. - Your Javascript can then trigger an event when one of those messages is received.
To listen for these messages, add Javascript to your container page that goes something like this:
window.addEventListener('message',function(message){ if(message.data.type == 'populi.application.start'){ alert('Do it!'); } });
0 Comments