Adding Event Tracking to Boost Forms

From Metro Studios Knowledgebase

Jump to: navigation, search

Contents

[edit] Instructions:

[edit] Find the form class file

[edit] Identify the number of pages

[edit] Adding the tracking tags

[edit] Old Code

protected function onSuccessPage[NUMBER](){
    echo "<script type=\"text/javascript\">_gaq.push(['_trackEvent', '[FORM NAME]', 'Submit', '[PAGE SUBMITTED OR COMPLETE]']);</script>";
}

[edit] New Code

protected function onSuccessPage[NUMBER](){
    echo "<script type=\"text/javascript\">ga('send', 'event', '[FORM NAME]', 'Submit', [PAGE SUBMITTED OR COMPLETE]');</script>";
}
echo "<script type=\"text/javascript\">ga('send', 'event', '[FORM NAME]', 'Submit', '[PAGE SUBMITTED]');</script>";

[edit] Save and Push

As always... if you do not feel comfortable doing this yourself, feel free to give a shout to your nearest friendly developer for assistance!

Personal tools
Namespaces
Variants
Actions
Wiki Navigation
Knowledgebase
Toolbox