Return to Snippet

Revision: 66204
at March 27, 2014 23:34 by Reiff


Initial Code
<input id="submit" onclick="trackpage('/kontaktudfyldt/')" type="submit" value="<?php _e('Send Email', 'framework') ?>" />
 <script type="text/javascript">
 // <![CDATA[
 var readytosubmit = false;
 function trackpage (track)
 {
 _gaq.push(['_trackPageview',track]);
 readytosubmit = !readytosubmit;
 setTimeout(clicksubmit(), 100)}
 function clicksubmit()
 {
 document.getElementById("submit").click();
 }
 // ]]>
 </script>

Initial URL
http://snippets.reiffs.dk/simuler-et-view-af-en-side-med-javascript-onclick/

Initial Description
Simulates a click on a page with the name you put in the parameter in the onclick function.

Initial Title
Simulate a click with javascript for WordPress and GA

Initial Tags
google, wordpress

Initial Language
JavaScript