This is a suggestion both for users that may have my same needs, and for the developers of this great plugin. I think it could be useful because i didn't find a ready-made solution on the web.
I needed to track the number of clicks on the "send" button, but only the good ones (that is, only when the user compiles the form correctly). To do this, I wanted to use Google Analytics event monitoring:
_gaq.push(['_trackEvent', 'category', 'action', 'label']);
First I noticed that Contact Form 7 has the "Additional Settings" field. It is perfect, because it executes javascripts using the event "on_sent_ok".
So i should write, in this field:
on_sent_ok: "_gaq.push(['_trackEvent', 'category', 'action', 'label']);"
However, this event isn't called anymore when you install Email Before Download.
Nevertheless, i noticed that the same event is present inside the file email-before-download.php, in the plugin folder, about line 480:
$cf7->additional_settings = "on_sent_ok: \"document.getElementById('wpm_download_$dId').style.display = 'inline'; document.getElementById('wpm_download_$dId').innerHTML='The link to the file(s) has been emailed to you.'; \"";
I modified it in this manner, adding Analytics event tracking:
$cf7->additional_settings = "on_sent_ok: \"document.getElementById('wpm_download_$dId').style.display = 'inline'; document.getElementById('wpm_download_$dId').innerHTML='The link to the file(s) has been emailed to you.'; _gaq.push(['_trackEvent', 'category', 'action', 'label']); \"";
Obviously, you have to modify the line for all the sending methods you want to use ("inline", "email" or "both"). I tested it for "email" method and seems to be ok.
NOTICE: you must have Analytics tracking script on the HEAD tag of your page: i.e., I use "Google Analytics for WordPress" plugin by Yoast. If you exclude the Admin from Analytics reports inside Yoast settings, the click events will not be monitored too. You have to log out from WordPress to check if the event tracking is ok.