Piwik async

Hi,
I am new to Piwik and it is really a good project.
Trying to test the async api with contact form 7 in wordpress, I wish to push the email field in a custom variable.
I set :
$(window).load(function() {
$(’.wpcf7-submit’).click(function(){
var myemail;
myemail=$(’.wpcf7-email’).val();
_paq.push([‘setCustomVariable’,‘1’,‘custemail’,myemail]);
});})

but the custom variable is not set when I submit the form.
Could you please help with my code? Thank you

You need to set the custom variable, but also send the tracking request via trackPageView() after calling setCustomVariable

thank you Matt for your prompt reply.

You meant this way?

$(window).load(function() {
$(’.wpcf7-submit’).click(function(){
var myemail;
myemail=$(’.wpcf7-email’).val();
_paq.push([‘setCustomVariable’,‘1’,‘custemail’,myemail]);
_paq.push([‘trackPageView’]);
});})

by the way, setCustomVariable needs the final parameter “visit” or it is optional?

Thank you
carlo

It works now, thank you

carlo