=== UCD Ads for WooCommerce ===
Contributors: urbancraftdepartment
Tags: woocommerce, ads, advertising, monetization, ad network
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
WC requires at least: 7.0
WC tested up to: 9.3
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically show UCD Ads Network ads on your WooCommerce shop, product, cart, and checkout pages — no shortcode to place by hand.

== Description ==

UCD Ads Network is a self-serve ad network: advertisers set up their own campaigns with their own
budget, and publishers (you) automatically earn credit every time one of those ads is shown on
your site.

This is the WooCommerce-specific version of UCD Ads Network's WordPress plugin. Instead of placing
a shortcode yourself, you connect your account once and toggle on the storefront placements where
you want ads to appear — this plugin handles inserting them at the right spot on each page.

**Placements you can enable, each with its own ad unit:**

* Shop page — top of the product grid
* Single product page — just below "Add to cart"
* Cart page
* Order received / thank-you page

**How it works:**

1. Create a free account at ads.urbancraftdepartment.com, go to Settings → API Keys, and generate
   a key.
2. Go to WooCommerce → Settings → UCD Ads and paste that key in to connect your account.
3. Pick an existing ad unit from the dropdown for each placement you enable, or create a new one
   without leaving the page.

An ad only appears once a matching, active campaign exists — an empty placement simply means no
suitable campaign is bidding at that moment, not an error.

Prefer to place ads yourself instead of the fixed placements above (e.g. inside a specific page
template)? Use the general-purpose "UCD Ads Network" plugin's `[ucd_ad]` shortcode alongside this
one — both can be installed at once.

== Installation ==

1. Make sure WooCommerce is installed and active.
2. Upload the plugin folder to `/wp-content/plugins/`, or install it through the WordPress plugin
   screen.
3. Activate the plugin through the "Plugins" screen.
4. Go to WooCommerce → Settings → UCD Ads, connect your account with an API key, then enable and
   configure the placements you want.

== Frequently Asked Questions ==

= I don't see an ad on a placement I enabled — is something broken? =

Not necessarily. A placement only shows an ad when there's currently an approved, paid campaign
that matches (every ad unit here auto-scales to fit, so size is never the blocker) and is within
budget and targeting. If none exists, the placement simply stays empty — that's normal, not a
fault.

= Do I need a different ad unit for every placement? =

No, you can reuse the same one everywhere, or create a separate one per placement — up to you.

= How and when do I get paid? =

UCD Ads Network works with credit, not direct payout: every ad shown earns credit on your UCD Ads
Network account, automatically deducted from your own next invoice there. See
ads.urbancraftdepartment.com/hoe-het-werkt for the full explanation.

== External services ==

This plugin connects to UCD Ads Network (ads.urbancraftdepartment.com) to serve ads and manage
your publisher account. It requires a free account on that service to function.

The following happens:

* **When you connect your account** (WooCommerce → Settings → UCD Ads): the API key you paste is
  sent to ads.urbancraftdepartment.com to verify it and fetch your organization's account info.
* **When you list or create an ad unit**: your site's domain name and the ad unit's name are sent
  to ads.urbancraftdepartment.com, using your stored API key for authentication.
* **On every page view of an enabled placement** (shop, product, cart, or thank-you page): the
  visitor's own browser loads a small script directly from ads.urbancraftdepartment.com
  (`/ucd-embed-autoscale.js`) and requests an ad to display. As with any such request, the
  visitor's IP address, User-Agent, and referring page URL are visible to
  ads.urbancraftdepartment.com — the same as loading an image or script from any other external
  site. This is the plugin's core function and cannot be disabled while still showing ads. No
  advertising cookies are set by this request.
* **When a visitor clicks an ad**, their browser is redirected through
  ads.urbancraftdepartment.com/v1/click/... to the advertiser's own site, so the click can be
  attributed and the advertiser's campaign charged.

UCD Ads Network Terms of Service: https://ads.urbancraftdepartment.com/voorwaarden
UCD Ads Network Privacy Policy: https://ads.urbancraftdepartment.com/privacy

== Screenshots ==

1. Connecting your account under WooCommerce → Settings → UCD Ads.
2. Enabling a placement and picking an ad unit for it.

== Changelog ==

= 1.0.1 =
* Fixed: the API key field hardened against browser/password-manager autofill interference that
  could silently overwrite a freshly entered key with an old value.

= 1.0.0 =
* First release: connect an account, and enable/configure ads on the shop, single product, cart,
  and thank-you pages.
