Additional Settings
-
Hi folks,
I’m adding some Google tracking when the form is successfully sent and have this set up as:
on_sent_ok: "_gaq.push(['_trackEvent', 'Contact Form', PAGE TITLE, 'Sent',, false]);"
This all works, of course, but I’m wanting to insert the title of the page the form you are viewing is on (as the form is on every page…) so I can then see which pages get most contact forms sent.
I tried adding some PHP to this:
<?php the_title(); ?>
which didn’t work and then tried setting up a variable and adding this in:var flexPageTitle = $('.header-page-title').text(); on_sent_ok: "_gaq.push(['_trackEvent', 'Contact Form', flexPageTitle, 'Sent',, false]);"
But it states that flexPageTitle is undefined…
Any help or ideas? Thanks.
R
- The topic ‘Additional Settings’ is closed to new replies.