=== MeetAdmiral Conversion Tracking for Google Ads ===
Contributors: 4ugusta
Tags: google ads, conversion tracking, gtag, ppc
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.3.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Report Google Ads conversions from WordPress — thank-you pages, phone taps, WhatsApp taps and Contact Form 7. No code, no tag manager.

== Description ==

If you advertise on Google Ads and you cannot see which clicks turned into
enquiries, Google is guessing on your behalf. Conversion tracking is what
stops the guessing — and it is two pieces: the Google tag on your site, and a
line of code on the moment somebody actually gets in touch.

Most plugins do the first piece. This one does both.

**What it does**

* Loads the Google tag for your Google Ads account — but only if nothing else
  on your site is already loading one.
* Reports a conversion when somebody reaches your thank-you page.
* Reports a conversion when somebody taps a phone number on your site.
* Reports a conversion when somebody taps a WhatsApp link.
* Reports a conversion when somebody sends a Contact Form 7 form.
* Optionally tells search engines who the business is: its name, website,
  what it does and where, as structured data on your home page.

**It will not double-count your leads**

Two Google tags for the same account count every enquiry twice, which is
worse than having none at all. On its default setting this plugin looks for
Site Kit by Google and for other plugins that load the Google tag, and steps
aside when it finds one — still reporting your conversion, without adding a
second tag. It cannot see a tag that a plugin or your theme prints straight
into the page, so if you know you have one, set "Load the Google tag" to
"Never" and this plugin will only report the conversion.

**Plain settings, no account required**

Two boxes and a few tick-boxes on one screen under Settings. There is nothing
to sign up for, no key to paste, and the plugin never contacts us — see
"External services" below for the only outside connection it makes, which is
Google's own tag.

**Built by the team behind Admiral**

Admiral (meetadmiral.com) runs Google and Meta ads for small businesses. It
finds what a Google Ads account is wasting money on, proposes the fix, and
keeps a receipt you can undo. It can set this plugin up for you and then
check, from the outside, that the tag really is on your page — but the plugin
is free, complete, and works perfectly well on its own.

== Installation ==

1. Install and activate the plugin.
2. Go to **Settings → Conversion Tracking**.
3. Paste your Conversion ID and Conversion label from Google Ads (the FAQ
   below says exactly where to find them).
4. Add the page people land on after they get in touch, and tick any of the
   tap triggers you want.
5. Save. Load your own site and, if you like, use Google's Tag Assistant to
   watch the tag fire.

== Frequently Asked Questions ==

= Where do I find my Conversion ID and Conversion label? =

In Google Ads: **Goals → Conversions → Summary**, click the conversion you
care about, then **Tag setup → Use Google Tag Manager**. Google shows you a
Conversion ID beginning with `AW-` and a Conversion label. Those are the two
values this plugin asks for.

= I already use Site Kit by Google. Do I need this? =

Site Kit puts the Google tag on your site, which is half the job — it does not
report which conversion happened. This plugin adds the other half. Leave
"Load the Google tag" on its default setting and it will notice Site Kit and
not add a second tag.

= Does this send anything to Admiral, or to you? =

No. The plugin makes no outgoing requests of its own at all. It stores your
settings in your own database and prints Google's tag on your pages. Nothing
is sent anywhere else.

= Will this slow my site down? =

The Google tag is loaded asynchronously, the way Google recommends. The
plugin's own code is a few kilobytes: a small configuration block in the page
head, and — only if you tick one of the tap triggers — one script at the foot
of the page.

= It is not counting my conversions. What now? =

Three things are worth checking, in this order. First, that the conversion you
picked in Google Ads is the same one whose ID and label you pasted. Second,
that your thank-you page path matches exactly — `/thank-you` and
`/thank-you-page` are different pages. Third, that a caching or optimisation
plugin is not stripping inline scripts from your pages.

= What is the business details section for? =

A home page with no structured data leaves Google and AI assistants to guess
who is behind it. Fill in the name and the website and the plugin prints one
small schema.org Organization block on your home page, with the description
and places served if you give them. Nothing else is added, and nothing is
printed while the name or the website is empty. If an SEO plugin such as
Yoast or Rank Math already describes your business, leave this empty, because
two descriptions can contradict each other.

= Does it work with WooCommerce purchases? =

Not on purpose. Google's own "Google for WooCommerce" plugin already handles
purchase tracking, and running both would count every order twice. Use this
one for enquiries, phone taps and forms.

== Screenshots ==

1. One screen under Settings. The panel on the right says what your site is
   doing right now, including the exact value reported to Google and the list
   of things that trigger it.
2. The status panel on its own.
3. A Conversion ID that could not be read. It is refused with the shape that
   was expected, your working value is left alone, and what you typed is
   handed back so you can correct it.

== External services ==

This plugin loads **Google's global site tag (gtag.js)** from
`https://www.googletagmanager.com/gtag/js`, and uses it to report conversions
to Google Ads. This is the service the plugin exists to configure; without it
there is nothing to report to.

* **What is sent:** the page address being viewed, the referring address, the
  visitor's IP address and browser details as part of a normal web request,
  and the Google Ads click identifier if the visitor arrived from one of your
  ads. When one of your chosen triggers happens, the conversion you configured
  is reported as well.
* **When it is sent:** on every page view once a Conversion ID and label are
  saved, and additionally at the moment a trigger fires.
* **Who sends it:** the visitor's browser, directly to Google. This plugin's
  server-side code never contacts Google or anyone else.

Google's terms: https://policies.google.com/terms
Google's privacy policy: https://policies.google.com/privacy

By configuring this plugin you are choosing to load Google's tag on your site.
Depending on where your visitors are, you may need a cookie or consent notice;
this plugin does not provide one and does not interfere with one you already
have.

== Changelog ==

= 1.3.1 =
* The settings screen uses Admiral's navy and orange: navy text and headings,
  orange only on buttons. Nothing else changes.

= 1.3.0 =
* New, optional: tell search engines who the business is. A separate form
  under the conversion settings prints one schema.org Organization block on
  the home page from the name, website, description and places you enter.
  It is off until the name and the website are filled in, is saved on its
  own so it never touches the conversion settings, and is removed with the
  plugin.

= 1.2.0 =
* Renamed to MeetAdmiral Conversion Tracking for Google Ads. Your settings,
  the values already stored and the REST route are unchanged; only the name
  and the address in the plugin directory are different.

= 1.1.0 =
* A Conversion ID or label that cannot be read is now refused out loud
  instead of being silently stored as blank. It no longer overwrites a
  working value, the settings screen says what shape was expected, and it
  hands back what you typed so you can correct it.
* The same two formats are checked in the browser as you leave the field, so
  a mistake is caught while the Google Ads tab is still open.
* Pasting the whole `AW-123456789/AbC-D_efGh` value into the Conversion ID
  box now splits it across both fields instead of complaining.
* Lines that cannot be used as pages are listed rather than dropped quietly.
* The REST API answers 400 on a malformed Conversion ID rather than 200, so a
  tool writing these settings is told when it got them wrong.
* Redesigned settings screen: what your site is doing right now, including the
  exact value reported to Google and the list of things that trigger it.

= 1.0.0 =
* First release. Google tag loading with duplicate detection, conversion
  reporting on thank-you pages, phone taps, WhatsApp taps and Contact Form 7.

== Upgrade Notice ==

= 1.3.1 =
Colour update for the settings screen. No settings change.

= 1.3.0 =
Adds an optional business details section. Your conversion settings are
unchanged.

= 1.1.0 =
Invalid values are no longer saved as blank without telling you. Worth
updating if you have ever wondered why a tag stopped reporting.

= 1.0.0 =
First release.
