• Resolved benhartwich

    (@yoursql719)


    Hi,

    I want to set a piwik goal at contact form 7, when an email is sent (submit button is clicked).

    I′ve created a goal and the site is linked via wp piwik to piwik. I can set additional settings at contact form for each form. Example: on_sent_ok:trackGoal(1);
    This code is not working: Uncaught ReferenceError: trackGoal is not defined.

    I′ve googled a lot, I′ve tried a lot.
    This code is also not working:
    on_sent_ok:piwikTracker.trackGoal(1);

    How can I set a piwik trackGoal command? I don′t know how wp piwik can transfer such commands to piwik and how commands have to look like. Any hints?

    Best,

    https://www.ads-software.com/plugins/wp-piwik/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author braekling

    (@braekling)

    WP-Piwik just adds the tracking code to your site. The tracking is done by Piwiks tracking code… the same way it’s done if you add the tracking code manually.

    Have a look at the Piwik documentation on how to manually trigger goals:
    https://developer.piwik.org/guides/tracking-javascript-guide#manually-trigger-goal-conversions

    // logs a conversion for goal 1
    _paq.push(['trackGoal', 1]);

    If you need further support on Piwik and goal tracking, you should ask in the Piwik community forum: https://forum.piwik.org/

    Thread Starter benhartwich

    (@yoursql719)

    Thanks, but this code doesn′t work: _paq is not defined is the error. Sure, it′s not a WP-Piwik issue?

    Plugin Author braekling

    (@braekling)

    Please keep in mind: If you are using the tracking filter, the tracking code is not added to your page as long as you are logged in. So the _paq is not defined, of course. To avoid this error for logged in users, you should disable the tracking filter feature.

    Did you solve it already? (The thread was marked as resolved?)

    Thread Starter benhartwich

    (@yoursql719)

    Yes, it′s solved. The code is:
    on_sent_ok: "_paq.push(['trackGoal', 1]);"

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Contact Form 7 set goal’ is closed to new replies.