How To Embed Google Analytics Into Your Form
One question I often hear is, “How do I insert my tracking code, such as Google Analytics, into my form?” I did a blog post last year telling you how to embed basically anything into a form using a Section, but now we have Description Area fields as well, which can be even more useful for embedding things like videos, widgets, tracking codes, etc.
Once you have your Google Analytics or other tracking code that you want to insert, open your form in build mode and click on “Add Field”. You will want to then choose “Description Area”. In the description area field, you will see a link under “content” that says “use plain text editor”. Click on this text to switch to plain text editor mode. Now paste in your tracking code here and hit the “Save” button.

Your code has now been added to your form, although the field and code won’t visibly show up in the form builder or on the form. You can switch the description area back to rich text if you like and add text to that field as you normally would, or you can leave it blank. Either way, the code is now on your form and should begin tracking hits.







12 Responses to “How To Embed Google Analytics Into Your Form”
Today’s Startup and Entrepreneurial Updates | CenterNetworks
[...] How To Embed Google Analytics Into Your Form – FormSpring [...]
Ron Jones
This is useful information. However, is there a way to embed the code only when a form is submitted? For GA we normally like to indicate a conversion when a form is submitted rather than viewed.
Thanks,
Ron
MaureenMcCabe
Does it work with the free account?
Ryan
Ron: Embed the code on your custom confirmation page instead of on the form.
Maureen: Yes, it will work on a free account.
Josh
Thanks – I managed to add the tracking code to my form, but I can’t get Google Analytics to create a profile for my form so that I can view the info that’s tracked. It doesn’t recognize the url of my form, so doesn’t know where to look… Am I doing this right? What Formspring url should I be directing it to track?
ryan
Set the URL to the URL of your form. The one you find on the Use page.
Elise Whitworth
Hi,
Nice tip — same goal as Ron Jones — needed tracking pixel on the confirmation page for our tracking code.
However, with a formspring that’s integrated with paypal, we have no control over the confirmation page (or that’s what I was told).
Any way around this?
ryan
You can set a Return URL on the Paypal integration page inside of FormSpring. That would be a URL on your website that you use as a confirmation page. Users would be taken there after they pay with PayPal. Place your tracking code on that page.
Josh
Great, thanks. Will Analytics be able to track activity from the URL if the form is embedded?
ryan
Josh, if you are embedding the form, you can place the tracking code on the page you are embedding the form on.
But yes, it should work if you embed.
Tim
does the code track each page separately in a multipage form?
Ryan
No, it would not track pages separately, as the “pages” in a multi-page form are just an illusion. The form is actually a single page, we just format it to appear as if it is multiple pages.