• Roundup WP
  • Products
    • Registrations for the Events Calendar Pro
      • Buy Now
      • Setup (Pro)
      • Demo
    • Stripe Extension
      • Buy Now
      • Setup
    • Mailchimp Extension
      • Buy Now
      • Setup
    • RTEC Memberships
    • RTEC WooCommerce Payments
    • Mollie (iDEAL) Extension
      • Buy Now
      • Setup
    • Discount Codes Extension
      • Buy Now
      • Setup
  • Blog
  • Support
    • FAQs and Troubleshooting
    • Codex
    • Contact Support
  • My Account
  • Get Pro

How Can I Set up a Google Analytics Tracking Event for Registrations?

Last updated on July 3, 2016

The Registrations for the Events Calendar plugin fires a JavaScript event after a successful registration. You can use this event in your JavaScript code to track conversions using Google Analytics.

You can use this code as a guide to how you can set up your tracking. You can add it to the “Custom JavaScript” area found on the “Form” tab inside the Registrations settings page.

jQuery(window).on('rtecsubmissionajax', function (event) {
    var eventID = event.el.attr('data-event'), // Event post ID
        eventTitle = jQuery('.tribe-events-single').find('.tribe-events-single-event-title').length ? jQuery('.tribe-events-single').find('.tribe-events-single-event-title').text() : jQuery('h1').first().text(); // Title of event or title of page
    ga('send', {
        hitType: 'event',
        eventCategory: 'Registration',
        eventAction: 'submit',
        eventLabel: eventID + ' - ' + eventTitle
    });
});
Registrations for the Events Calendar Pro logo
Learn about the plugin our users are raving about Unmatched customer support from WordPress experts. Learn More