=== AdvisorPPC – Ads Tracking for Google Ads, GA4, Tag Manager, Search Console & YouTube ===
Contributors: advisorppcai
Tags: analytics, tracking tags, consent mode, click tracking, tag manager
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Ad tracking for WordPress: Google Ads, GA4, Tag Manager, Meta, TikTok and Microsoft tags, Consent Mode, click IDs. Free, no account.

== Description ==

AdvisorPPC captures the ad clicks that land on your WordPress site: Google Ads, GA4, Tag Manager, Meta, TikTok and Microsoft tags, Consent Mode and click IDs, free. Server-side conversions through an AdvisorPPC workspace are planned for a later version.

* Tracking tags: GA4, Google Ads, Google Tag Manager, Meta Pixel, TikTok, Microsoft UET, LinkedIn Insight and Pinterest. Enter the IDs for the platforms you use; leave the rest blank.
* Consent Mode: off, basic and advanced settings, with a bridge to the consent banner you already run.
* Auto setup: scans other plugins' settings, your theme and your own home page for tags you already have, and lets you apply the ones that are safe to load here, with a receipt and Undo for every change.
* Click-ID capture: saves gclid, gbraid, wbraid, fbclid, msclkid, ttclid, li_fat_id, twclid and epik from landing URLs in a first-party cookie.
* Site verification: paste the verification token from Google Search Console, Bing Webmaster Tools, Pinterest or Meta and the plugin prints the matching meta tag in your page head. Nothing is contacted; the service reads the tag when you ask it to verify.
* YouTube video tracking (off by default): adds `enablejsapi=1` and your site's origin to the YouTube embeds you already have, so GA4 enhanced measurement and Tag Manager's YouTube trigger can record play, progress and complete. No YouTube script is added.

Site verification and YouTube video tracking are helpers around your ad tracking: one prints ownership meta tags, the other prepares your existing embeds for GA4 and Tag Manager. Neither one tracks anything by itself.

**Privacy and local storage**

The plugin does not send data to AdvisorPPC. Configured tags communicate with their advertising or analytics platform, as described below. The optional debug log stays on your own server and is never uploaded.

The plugin uses first-party cookies on your domain: `advisorppc_cids` holds advertising click IDs, a random session identifier, landing page and referrer for 90 days; `advisorppc_consent` holds the choices your consent banner reports for 180 days; `advisorppc_pending` can hold a signed browser cart-event hand-off for 10 minutes.

**Trademarks**

Google Ads, Google Analytics, Google Tag Manager, Search Console and YouTube are trademarks of Google LLC. Meta, TikTok, Microsoft, LinkedIn and Pinterest are trademarks of their owners. AdvisorPPC is not affiliated with or endorsed by them.

== External services ==

= AdvisorPPC hosts =

`advisorppc.com`, `advisorppc.ai` and their subdomains, including `mcp.advisorppc.com` and `shield.advisorppc.ai`, are not contacted by the plugin in this version. Workspace features are disabled in this build. There is no connection flow, version check or usage telemetry to AdvisorPPC.

AdvisorPPC terms and privacy links are provided for reference. They open only if you choose to follow them:

* Terms of service: https://advisorppc.com/terms
* Privacy policy: https://advisorppc.com/privacy

= Your own site (Auto setup) =

When you click Scan, your server fetches your own home page once to look for existing tags; nothing is sent to AdvisorPPC.

= Advertising and analytics platforms you configure =

Powers the "Tracking tags" module. Each of these is contacted **only if you enter that platform's measurement ID, or explicitly apply a detected ID with Auto setup,** in the plugin settings, and only on the pages where the tag is loaded. No AdvisorPPC account is needed or involved. Leave a field blank and its host is never contacted.

* Analytics measurement ID, Google Ads conversion ID: `www.googletagmanager.com`, operated by Google LLC. The Google tag then sends its measurements to Google's collection hosts, such as `www.google-analytics.com`, `region1.google-analytics.com`, `googleads.g.doubleclick.net`, `www.google.com` and `www.googleadservices.com`.
* Tag Manager container ID: `www.googletagmanager.com`, operated by Google LLC. A Tag Manager container also loads whatever tags its owner has added to it inside Google Tag Manager; those are set up in your Google account, not in this plugin.
* Meta pixel ID: `connect.facebook.net` and `www.facebook.com`, operated by Meta Platforms, Inc.
* TikTok pixel ID: `analytics.tiktok.com`, operated by TikTok Ltd.
* Microsoft UET tag ID: `bat.bing.com`, operated by Microsoft Corporation.
* LinkedIn partner ID: `snap.licdn.com` and `px.ads.linkedin.com`, operated by LinkedIn Corporation.
* Pinterest tag ID: `s.pinimg.com` and `ct.pinterest.com`, operated by Pinterest, Inc.

*What is sent:* whatever that platform's own tag collects, which is typically the page address, referrer, a platform cookie identifier and the conversion events you have enabled. This is the same data the platform would receive if you pasted its snippet into your theme or loaded it through any tag manager. AdvisorPPC does not add fields to it and does not receive a copy.

*Consent:* if you set Consent Mode to basic or advanced, these tags are held or run in restricted mode until your consent banner reports a decision.

Each platform's own terms and privacy policy apply to the data its tag collects:

* Google: https://policies.google.com/terms and https://policies.google.com/privacy
* Meta: https://www.facebook.com/legal/terms and https://www.facebook.com/privacy/policy
* TikTok: https://ads.tiktok.com/i18n/official/policy/terms and https://www.tiktok.com/legal/privacy-policy
* Microsoft: https://about.ads.microsoft.com/en-us/resources/policies/microsoft-advertising-agreement and https://privacy.microsoft.com/privacystatement
* LinkedIn: https://www.linkedin.com/legal/l/ads-agreement and https://www.linkedin.com/legal/privacy-policy
* Pinterest: https://policy.pinterest.com/en/advertising-services-agreement and https://policy.pinterest.com/en/privacy-policy

== Installation ==

1. Install and activate the plugin.
2. Open **AdvisorPPC** in the WordPress admin menu.
3. Enter the measurement IDs for the platforms you use.
4. Choose your Consent Mode setting and connect your existing consent banner to the plugin's consent bridge.
5. Save changes. No AdvisorPPC account is needed.

== Frequently Asked Questions ==

= Do I need an account? =

No. Tracking tags, Consent Mode and click-ID capture work without an AdvisorPPC account or key. You use your existing advertising or analytics platform IDs to configure tags.

= Does this plugin send anything to AdvisorPPC? =

No. AdvisorPPC hosts are not contacted in this version, including on installation and activation. If you enter a measurement ID, or explicitly apply a detected ID with Auto setup, that platform's own tag loads on your pages and receives its normal measurements. The hosts and privacy policies are listed under "External services".

= Does this plugin include a consent banner? =

No. It provides a consent bridge for your existing banner. Choose basic or advanced mode and have your banner report choices through `window.advisorppc.consent.update()`.

With Consent Mode set to off (the default), your tags load and the click-ID cookie (90 days) is set on the first page view without waiting for consent; choose basic or advanced to make them wait for your consent banner.

= Can I verify my site with Search Console, Bing, Pinterest and Meta? =

Yes. Open **AdvisorPPC**, go to the Tags tab, find "Site verification" and paste the token each service gives you for its HTML or meta tag method. You can paste just the content value or the whole meta tag. The plugin prints one meta tag per filled-in field on your public pages. It does not contact any of these services; they read the tag when you click verify in their own tools.

= What does YouTube video tracking change? =

Only the address of YouTube videos your site already embeds. With the switch on, the plugin adds two URL parameters, `enablejsapi=1` and `origin` (your site's address), to each YouTube embed. Every other parameter stays, and an embed on youtube-nocookie.com stays on youtube-nocookie.com. GA4 enhanced measurement and Tag Manager's YouTube trigger need those two parameters to see play, progress and complete. The plugin loads no YouTube script and sends nothing itself. The video is still served by YouTube, and YouTube's own terms and privacy policy apply to it exactly as before.

= What happens if I delete the plugin? =

Deleting the plugin removes its settings from your database. The plugin no longer loads tags. Existing first-party cookies expire according to their lifetimes.

= Does Auto setup change other plugins' settings? =

No. Auto setup reads the settings of Site Kit by Google, GTM4WP, Google Analytics for WooCommerce and Facebook for WooCommerce with WordPress's read-only option lookup, and reads your theme's header.php, footer.php and functions.php. It never writes to another plugin's settings, never edits a theme file and never switches anything off. It only changes this plugin's own settings, for the rows you select, and each change can be undone from the same card. A tag that another plugin or your theme already loads is shown for inspection only and is never loaded a second time by this plugin.

= Where is the debug log written? =

To your own site's PHP error log, and only if you switch it on. It is never uploaded.

== Screenshots ==

1. The Overview tab: tracking tags work with no account, the module switch, things to look at, and the hosts each configured tag contacts.
2. The Tags tab: Google Analytics, Google Ads and Tag Manager measurement ID fields.
3. The Tags tab: measurement ID fields for Meta, TikTok, Microsoft, LinkedIn and Pinterest.
4. The Consent tab: the Consent Mode setting and how to connect an existing consent banner.

== Changelog ==

= 1.1.0 =
* New admin screen with tabs: Overview, Auto setup, Tags, Consent, Click IDs and Logs. Saving one tab never changes another, and a rejected ID now names the field and shows a valid example.
* Auto setup: finds tags your site already loads through other plugins, your theme or your home page, offers Apply only where this plugin would not load a tag twice, and keeps a receipt with Undo for every change. It contacts nothing but your own home page, and only when you click Scan.
* A tag that Site Kit, GTM4WP, Google Analytics for WooCommerce or Meta for WooCommerce already loads is no longer loaded a second time by this plugin.
* Site verification: meta tags for Google Search Console, Bing Webmaster Tools, Pinterest and Meta domain verification.
* YouTube video tracking (off by default): adds enablejsapi and origin to existing YouTube embeds so GA4 and Tag Manager can record video engagement.
* New plugin name: AdvisorPPC – Ads Tracking for Google Ads, GA4, Tag Manager, Search Console & YouTube.
* The Tracktor module ships hidden and switched off; it needs a workspace connection, which this build does not offer.
* Review fixes: escaping, nonce and capability checks on every new admin action, and no outbound request on activation.

= 1.0.0 =
* First public release.
* Tracking tags for GA4, Google Ads, Google Tag Manager, Meta Pixel, TikTok, Microsoft UET, LinkedIn Insight and Pinterest.
* Consent Mode with off, basic and advanced settings and a bridge to an existing consent banner.
* Advertising click-ID capture in a first-party cookie.

== Upgrade Notice ==

= 1.1.0 =
Adds a tabbed admin screen, Auto setup with Undo, site verification tags and YouTube video tracking; your existing settings are kept.

= 1.0.0 =
First public release.
