Embedding Script for GA, Gemius and Other External Tools


When you publish a web form, you always want to get as much information about its efficiency as possible. ActiveForms provides internal statistics for completed entries, but the owner of a form will inevitably want to connect it to a Google Analytics account.

Code for GA, Gemius, Coremetrics and other tools is embedded in the layout. Since a form layout is a HTML document that we freely create, we can embed any integration code in it. Many forms connect with multiple statistics engines at the same time. When embedding such code in ActiveForms, remember a few principles:

  • All script references must always use HTTPS. ActiveForms forms are always served via HTTPS, and if an element on the page (e.g. a Gemius script) tries connecting via HTTP, the browser displays security alerts. The default Google Analytics code detects the protocol automatically, but you need to take care of that yourself when using other tools.
  • If a tool code is to be executed only on the thank you page, use the isThankyouScreen() function or embed it in the thank-you screen body using the General Settings module.
  • If you embed counter code in the thank-you screen body, you can use $fieldcode$ variables, which will be replaced with form field values.

The first principle (connecting tools via HTTPS only) doesn’t apply just to counter scripts. Watch out for browser alerts also when embedding a Flash banner, for example. The standard Flash embedding code looks like this:

The banner configuration contains the URL where users can download the Flash plugin if necessary. If the address is specified with http (and not https), MS Internet Explorer will display an alert even if the plugin is installed and there is no HTTP connection at all!

recent posts
3rd Apr 2014
Faster than ever!
5th Dec 2013
Live validation!
2nd Dec 2013
Features distilled
12th Mar 2012
Flicking Channels
26th Jan 2012
Your Own Error Page
9th May 2011
Box Properties
15th Apr 2011
Grouping Fields
13th Apr 2011
Form Versioning
24th Feb 2011
Form Access Modes
22nd Feb 2011
Required Fields
4th Feb 2011