Created
February 7, 2019 14:19
-
-
Save WordPress-Handbuch/9fffa538cb2ad24fa042159dddea7bb7 to your computer and use it in GitHub Desktop.
Example PHP/jQuery Matomo fragment to track form field clicks in the plugin »Quiz and Survey Master« (V6.2.0, class-qmn-quiz-manager.php, insert at line 314)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$quiz_display .= "<script>\n"; | |
$quiz_display .= " jQuery(document).ready(function () {\n"; | |
$quiz_display .= " jQuery('.qmn_quiz_form input').click(function () {\n"; | |
$quiz_display .= " _paq.push(['trackEvent', 'Quiz', 'Klick', jQuery(this).attr('ID') + '-' + jQuery(this).attr('value')]);\n"; | |
$quiz_display .= " });\n"; | |
$quiz_display .= " });\n"; | |
$quiz_display .= "</script>\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment