I see. The form field exists and the visitor enters their coupon code. You want to track what they enter. Try adding this jQuery to an HTML field in your form:
<script type="text/javascript">
jQuery('#input_229_1').change(function() {
alert('.change() called for field 229_1');
pageTracker._trackEvent('Coupons', this.form.action, this.value);
});
</script>
The coupon field in my form #229 is field 1, which is why line 2 has "input_229_1" - update this to the field where your coupon code is being entered.
You can remove the "alert" line once you are sure this code is being executed.
This should work if Google Analytics is present on the page. Let us know if you need help. Please provide a link to your form online if you need additional assistance.
Posted 12 years ago on Friday December 14, 2012 |
Permalink