Adding Google Adwords Conversion Tracking Code – Using Silverstripe Userforms Module

If you are running a Google Awords campaign it makes sense to start measuring conversions using the conversion tracking code. It something so simple to implement and it provides very insightful information, yet surprisingly many people don’t use it – often because they lack the technical ability to implement it.

If your site has been built using SilverStripe and your contact page uses the User Forms module, then this tutorial is for you!

The first thing to do is create the grab the tracking code from your adwords account:

adwords conversion

It is not possible to simply drop the code into the WYSIWYG editor. Looking through the forum and various sites, it seems that many people have tried to add the conversion code after the “on completion” message which is displayed to users after they have submitted an enquiry. The TinyMCE editor does not recognise the script tags used in the tracking code and will automatically delete most of it out – this will cause display errors on the page and also stop the tracking code from working correctly.If you have tried that, you will have first hand experience of this!

Adwords Tracking Code to the User Forms Module

The easiest and simplest way of adding the code is to drop it into the “ReceivedFormSubmission.ss” file

The file can be found here: userforms > templates > ReceivedFormSubmission.ss

userforms

When you open the file, it contains just one line of code – this is the command to call in the on completion message that you specify from within the CMS. By dropping in the conversion code, it will be inserted just after the message to your users.

received form submission

After you have inserted the code, upload the file and then flush the cache and then you can start putting through some tests to check that its all working correctly.

Leave a Reply