VinhXD Lead Tracking for Google Ads and Zalo

Description

Theo Dõi Chuyển Đổi XD (“XD Conversion Tracking”) helps Vietnamese small businesses that run Google Ads, such as car dealers, real estate agents and local services, measure real leads:

  • Phone clicks (tel: and callto: links)
  • Zalo clicks (zalo.me, chat.zalo.me, zalo:// links, popular floating Zalo buttons and the Zalo chat widget). Zalo is the most popular messaging app in Vietnam.
  • Messenger (m.me, messenger.com) and SMS (sms:) clicks, optional
  • Successful form submissions only. Clicking the submit button of a form that fails validation is not counted.

Each type has its own Google Ads conversion label and its own default conversion value (in VND). Conversions are sent with gtag('event', 'conversion') using transport_type: beacon so they are not lost when the page navigates away, and duplicate events within 3 seconds are ignored.

The admin screen is in Vietnamese because the plugin is built for Vietnamese site owners.

Supported form plugins

  • Contact Form 7: wpcf7mailsent event
  • Elementor Pro Forms: submit_success event
  • WPForms: wpformsAjaxSubmitSuccess event, non-AJAX forms via the wpforms_process_complete hook
  • Gravity Forms: gform_confirmation_loaded event, non-AJAX forms via the gform_after_submission hook
  • Fluent Forms: fluentform_submission_success event
  • Ninja Forms: nfFormSubmitResponse event (ignored when the response contains errors)
  • Formidable Forms: frmFormComplete event, non-AJAX forms via the frm_after_create_entry hook
  • Forminator: forminator:form:submit:success event
  • MetForm: metform/after_submit event (successful responses only)
  • JetFormBuilder / JetEngine Forms: jet-form-builder/ajax/on-success event
  • Any other form: a thank-you page URL (for example /cam-on), or call xdDcd.track('form', {plugin: 'custom'}) from your own code

You can use one conversion label for all forms or a separate label per form plugin.

Other features

  • Loads the Google tag (gtag.js) with your own Google Ads ID and optional GA4 ID, or reuses an existing Google tag (Site Kit, GTM4WP and similar plugins are detected). A button checks your home page for existing gtag.js / Google Tag Manager tags.
  • GA4 events: click_call, click_zalo, click_messenger, click_sms, generate_lead.
  • Google Tag Manager dataLayer events: xd_dcd_call, xd_dcd_zalo, xd_dcd_messenger, xd_dcd_sms, xd_dcd_form.
  • Enhanced Conversions, off by default: the email and phone number typed into the form are normalized (Vietnamese phone numbers to E.164 +84…) and hashed with SHA-256 in the visitor’s browser before being passed to the Google tag.
  • Test mode: logs events to the browser console and shows a small on-page notice. Only visible to logged-in administrators.
  • Clicks by logged-in administrators are not sent by default.
  • Local counter: daily totals per type for the last 7 and 30 days, to compare with Google Ads. Only aggregate numbers are stored, no personal data.
  • Buttons that are not links can be tracked with extra CSS selectors or a data-xd-dcd="call|zalo|messenger|sms" attribute.

Third-party service: Google tag

This plugin relies on Google’s measurement services. When you enter a Google Ads ID or GA4 ID, the visitor’s browser loads the Google tag (gtag.js) from https://www.googletagmanager.com/gtag/js (unless you choose to reuse a Google tag that is already on your site) and sends event data to Google Ads and/or Google Analytics: the click or form event, the page address, the clicked link, browser information and Google’s measurement cookies. If you turn on Enhanced Conversions, a SHA-256 hash of the email address and phone number entered in the form is also sent to Google.

  • Google Terms of Service: https://policies.google.com/terms
  • Google Privacy Policy: https://policies.google.com/privacy
  • Google Ads Terms: https://ads.google.com/home/terms/
  • Customer data policies (Enhanced Conversions): https://support.google.com/adspolicy/answer/7475709

No data is sent to the plugin author, and the plugin does not contact any other external server. The “Kiểm tra ngay” (check now) button on the settings page only requests your own site’s home page.

You are responsible for obtaining visitor consent where required by applicable law, for example Vietnam’s Decree 13/2023/ND-CP on personal data protection.

Installation

  1. Install the plugin from Plugins > Add New, or upload the vinhxd-lead-tracking folder to /wp-content/plugins/, then activate it.
  2. Go to Settings > Theo Dõi Chuyển Đổi XD.
  3. Follow the built-in guide to create conversion actions in Google Ads (Goals > Conversions > New conversion action > Website > Add a conversion action manually). Suggested categories: “Contact” or “Phone call lead” for phone clicks, “Contact” for Zalo, “Submit lead form” for forms.
  4. Copy your Google Ads ID (AW-…) and each conversion label into the matching fields. You can paste the full AW-123456789/AbC… string and the plugin splits it.
  5. Save, turn on test mode, open your site in another tab and try the buttons and forms.

FAQ

My site already uses Site Kit or Google Tag Manager.

Choose “Tự động” (automatic, the default) or “Không chèn” (do not load). The plugin will not load gtag.js again and will use the existing Google tag. If your site only uses Google Tag Manager, keep the dataLayer option on and create Custom Event triggers for xd_dcd_call, xd_dcd_zalo and xd_dcd_form in GTM.

Is a failed form submission counted?

No. The plugin listens only to each form plugin’s “submission succeeded” event.

My Zalo button is not tracked.

Links to zalo.me are tracked automatically. For JavaScript buttons, add the button’s CSS selector (for example .zalo-button) in the Zalo row, or add data-xd-dcd="zalo" to the button. Turn on test mode to check.

Why does the local counter differ from Google Ads?

Google Ads only counts visitors who came from an ad, within the conversion window and according to the “One”/”Every” counting setting. The local counter counts every visitor except administrators, so it is usually higher. Ad blockers may also block the Google tag.

Does the plugin store customer data?

No. The local counter stores daily totals only. Enhanced Conversions, if enabled, hash the email/phone in the browser and pass only the hash to Google; nothing is stored on your site.

Does it work with caching and JavaScript optimization plugins?

Yes. Exclude xd-dcd-tracker.js and googletagmanager.com/gtag/js from “Delay JavaScript” features so early clicks are not lost. The local counter uses a nonce, so pages cached for longer than 12 hours may undercount in the local counter only (Google Ads is not affected).

How do I track a custom form?

After a successful submission call window.xdDcd.track('form', {plugin: 'custom', form_id: 'contact'}).

Reviews

There are no reviews for this plugin.

Contributors & Developers

“VinhXD Lead Tracking for Google Ads and Zalo” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.1

  • Renamed to “VinhXD Lead Tracking for Google Ads and Zalo” for the WordPress.org review (text domain and slug: vinhxd-lead-tracking). Admin screens stay in Vietnamese.

1.0.0

  • Initial release: phone, Zalo, Messenger, SMS click tracking and successful form submission tracking for 10 form plugins; Google tag, GA4, dataLayer, Enhanced Conversions, test mode and local counter.