

The code above can be added just before the embed code on your page (perhaps most useful for instances of a single form, i.e. “FormStack for Salesforce” iFrame Tracking in Google Analytics – JavaScript Recipe by UpBuild ( CodePen. Read on to see the five simple steps to take to use this function effectively. In order to initiate our function, we will be using FF_OnAfterSave. FF_OnAfterSave – This is useful for any custom behavior you would like to have triggered after a form has been successfully submitted and the form information has been saved to the database.This is useful for custom validation not covered by Formstack’s built-in functionality. FF_OnBeforeSave – This function will be executed after the user clicks the Send button on their form and before the Formstack rendering engine saves the form information.This may be useful for displaying instructions to the submitter after the form is displayed. FF_OnAfterRender – Defining this function in your page will cause the Formstack rendering engine to execute your custom code after your form has been rendered on the page.This might be useful if you needed to show a ‘please wait’ message to the user. FF_OnBeforeRender – Defining this function in your page will cause the Formstack rendering engine to execute your custom code before rendering the form.Understanding the JavaScript API Endpointsīefore diving into the method and code itself, let’s first take a look at the JavaScript API endpoint choices available to us. The method below should, in theory, work for any situation where you would like to send event information from behind an, as long as you have the ability to customize code on the source page. To keep things moving along (and to prevent the client from having to re-implement all their forms sitewide), we decided to investigate and find a solution to send as much event information from behind the as possible. Recently, an UpBuild client had transitioned from Contact Form 7 to Formstack for Salesforce, and had decided to implement a sitewide form using the method.

We’ve written a similar method on the topic of Formstack for Salesforce before, but found that this solution didn’t apply to forms that had selected the “ Use iframe” option when embedding the form: On the other side of the equation, the Formstack for Salesforce extension doesn’t offer any out-of-the-box solution to send data to Google Analytics either. I found it unusual that the native application would not include the same advanced JavaScript API capabilities that their Salesforce extension does. referral) because the forms are embedded using an and no cross-domain tracking has been applied. Otherwise, the source/medium for these form submissions will show in Google Analytics as a self-referral (i.e. Surprisingly, once the Conversion Kit is added to your account, the only way to track the source, medium, and other standard tracking information is to add UTM parameters to your forms. However, a native account (one not sending data into Salesforce) requires that you purchase their Conversion Kit before you can take advantage of any Google Analytics tracking features. My experience with Formstack has been eye-opening and seems to fall somewhere between seamless and challenging.įormstack for Salesforce, the extension designed specifically for the Salesforce platform, includes the ability to use several predefined JavaScript API endpoints that can be executed at key points of the form lifecycle. When it comes to tracking form events in Google Analytics, some third-party form platforms integrate seamlessly, while others can be a little more challenging.
