Getting Google Conversion Tracker to Work with Facile Forms

Locked
User avatar
dnobendno
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Sep 29, 2006 2:53 pm
Contact:

Getting Google Conversion Tracker to Work with Facile Forms

Post by dnobendno » Thu Jan 03, 2008 6:33 pm

I worked on this all morning and did not see any references to it in the forum so, here is how you can get your facile forms to work with Google's conversion tracker.

Someone may know a better way, but this one works.

I had to get put a redirect script into the form editor so that after the submit button is hit, the form sends the user to a unique landing (thank you) page. I created a template specific to that page that housed the javascript just before the /body tag (like it always should be). Then I found these scripting directions by "facile" on the facile forms forum:
Here is how it goes:

Go to the form scripts (Edit Form - Scripts)
At the submitted script click on Custom
Click on Create code framework
Leave the created function name as it is, but change the body as:

Code: Select all

function ff_SampleContactForm_submitted(status, message)
{
    switch (status) {
        case FF_STATUS_OK:
           ff_redirectParent(
               '{mossite}/index.php?option=com_content&task=view&id=5&Itemid=6', 
               'get'
           );
           break;
        case FF_STATUS_UNPUBLISHED:
        case FF_STATUS_SAVERECORD_FAILED:
        case FF_STATUS_SAVESUBRECORD_FAILED:
        case FF_STATUS_UPLOAD_FAILED:
        case FF_STATUS_ATTACHMENT_FAILED:
        case FF_STATUS_SENDMAIL_FAILED:
        default:
           alert(message);
    } // switch
} // ff_SampleContactForm_submitted
With those two steps combined, I was able to get a unique landing page with the javascript that tracks conversions in my analytics account, which will make my client pretty happy. I hope this helps someone else.

Dean

Locked

Return to “Tips & Tricks - Moving”