I saw the pastie that had this
<?php
add_action("gform_post_submission", "gf_ga_tracking", 10, 2);
function gf_ga_tracking($entry, $form) {
if($form['id'] != 4) return; ?>
<script type="text/javascript">
jQuery(document).ready(function($) {
_gaq.push(['_trackEvent', 'Forms', 'Submission', 'GA Testing Form FINAL']);
});
</script>
<div class="ga-confirmation">Nice! Your <strong>successful</strong> form submission was recorded by Google Analytics.</div>
<?php } ?>
We have multiple forms on our site. I want to track each individually (our form numbers are 1,2,6,7,8,9) with separate categories (same Action).
The reason for this is for segmenting within Google Analytics. Is there a way to alter the code above to account for 6 separate forms?
I'm comfortable putting things into the functions.php, but to someone's earlier point, it would be nice if, right under the field to change the Submit button text, we had the option to paste in the GA Event code.