Skip to main content
All CollectionsSign Up Forms
Custom Actions After Sign Up For Embedded Forms
Custom Actions After Sign Up For Embedded Forms

Redirect to custom links, log Google Analytics activities, and more when someone completes a Sign Up Form.

V
Written by VipeCloud Developer
Updated over 5 months ago

Embedding VipeCloud Sign Up Forms on your site gives you a more integrated user experience, and it can also give you access to more customized actions.

When someone completes an embedded Sign Up Form, we send a postMessage to the parent page. The only current requirement is that the form requests an email address.

Below are sample scripts you can add to your page to take custom actions:

Redirect to a custom page

Add the below code to the same page that your Sign Up Form is embedded:

<script>
// Function for processing received events
function receiveMessage(event){
// event = vc_form_complete~~~{submitted email}~~~{ip address if avail}
if (event.origin !== "https://v.vipecloud.com"){ //security check
return;
}
var pieces = event.data.split('~~~');
if(pieces[0] === 'vc_form_complete'){ //confirm event type
window.location = 'https://yourcustomredirect.com/path';
}
}

// Add the listener to start listening for form completions
addEventListener("message", receiveMessage, false);
</script>

Submit a completed conversion to Google Analytics

You have to have the Google Analytics script on your site for this to work.

<script>
// Function for processing received events
function receiveMessage(event){
// event = vc_form_complete~~~{submitted email}~~~{ip address if avail}
if (event.origin !== "https://v.vipecloud.com"){ //security check
return;
}
var pieces = event.data.split('~~~');
if(pieces[0] === 'vc_form_complete'){ //confirm event type
ga("send",{hitType:"event",eventCategory:"YourEventCategory",eventAction:"YourActionName"});
}
}

// Add the listener to start listening for form completions
addEventListener("message", receiveMessage, false);
</script>

Submit a completed conversion to Facebook Pixel

You have to have the Facebook Pixel script on your site for this to work. If you would like to review Facebook's documentation for pixel tracking, click here for their documentation.

<script>
// Function for processing received events
function receiveMessage(event){
// event = vc_form_complete~~~{submitted email}~~~{ip address if avail}
if (event.origin !== "https://v.vipecloud.com"){ //security check
return;
}
var pieces = event.data.split('~~~');
if(pieces[0] === 'vc_form_complete'){ //confirm event type
fbq('track', 'Lead', {
content_name: "VC Form Completion", // placeholder
email: pieces[1]
});
}
}

// Add the listener to start listening for form completions
addEventListener("message", receiveMessage, false);
</script>

You can really do anything you want in this script! You can submit conversions to Capterra, load a modal on the page, hide/show something on the page. Whatever you can imagine!

Did this answer your question?