Skip to content

Google Ads, GA4, Microsoft Ads and Meta without GTM

Are your ad tags placed directly on the page, without Google Tag Manager? Then listen for the meetpiloot event and send the conversion on yourself.

ProFor developers1 min read
On this page1
  1. Check that it works
Available on Pro.

If you do not use Google Tag Manager, and gtag, the Microsoft UET tag or the Meta Pixel sit directly on your page, add this script below the tracking script. It listens for the meetpiloot event and, when an enquiry is sent, passes on the conversion with its value, currency and transaction ID.

HTML
<script>
document.addEventListener('meetpiloot', function (e) {
  var data = e.detail;
  var payload = (data && data.payload) || {};
  if (data.event !== 'lead_submitted') return;

  // Google Ads conversion, with value, currency and transaction ID
  if (typeof gtag === 'function') {
    gtag('event', 'conversion', {
      send_to: 'AW-XXXXXXXXXX/YYYYYYY',
      value: payload.value,
      currency: payload.currency || 'EUR',
      transaction_id: payload.transactionId
    });
    // GA4 generate_lead, with the same transaction ID for deduplication
    gtag('event', 'generate_lead', {
      value: payload.value,
      currency: payload.currency || 'EUR',
      transaction_id: payload.transactionId,
      mp_product_type: payload.productType,
      mp_veranda_subtype: payload.verandaSubtype
    });
  }

  // Microsoft Ads (UET)
  if (typeof window.uetq !== 'undefined') {
    window.uetq.push('event', 'lead', {
      event_category: 'meetpiloot',
      event_label: payload.transactionId,
      revenue_value: payload.value,
      currency: payload.currency || 'EUR'
    });
  }

  // Meta Pixel (optional)
  // With eventID, Meta counts the request once, also when meetpiloot sends it through the Conversions API.
  if (typeof fbq === 'function') {
    fbq('track', 'Lead', {
      value: payload.value,
      currency: payload.currency || 'EUR'
    }, { eventID: payload.eventId || ('mp-' + payload.leadId + '-Lead') });
  }
});
</script>

Replace AW-XXXXXXXXXX/YYYYYYY with your own conversion ID and label from Google Ads.

Check that it works

Send a test enquiry and check in your browser's network panel that the conversion goes to Google, Microsoft or Meta. Or use the tracking test page.

Stuck?

Email us or open a ticket from your dashboard. We reply within 1 to 2 working days.