Full GA4 e-commerce tracking and Google Tag Manager integration for WordPress Download Manager.
Track every step of the customer journey — from product views and cart interactions to completed purchases and file downloads — using standard GA4 e-commerce events. All data flows through Google Tag Manager, giving you complete control over your analytics without touching a single line of code.
GA4 E-commerce Events
This add-on pushes industry-standard GA4 e-commerce events to your GTM dataLayer, enabling full funnel tracking:
- Product Views (
view_item) — Track when users view a package page
- Add to Cart (
add_to_cart) — Track items added to the shopping cart
- Remove from Cart (
remove_from_cart) — Track items removed from the cart
- View Cart (
view_cart) — Track when users view their cart
- Begin Checkout (
begin_checkout) — Track checkout initiation
- Add Payment Info (
add_payment_info) — Track payment method selection
- Purchase (
purchase) — Track completed orders with full transaction data (order ID, revenue, tax, items, coupon)
- Refund (
refund) — Track order refunds (full and partial)
Additional Events
- File Download (
file_download) — Server-side download tracking (works for both free and premium files)
- User Signup (
sign_up) — Track new user registrations
- User Login (
login) — Track returning user logins
- Order Renewals — Renewal purchases tracked as separate
purchase events with unique transaction IDs
Key Features
- Standard GA4 events — Uses official GA4 recommended event names and parameters, compatible with all GA4 reports
- Rich item data — Every event includes product name, price, category, SKU, quantity, and discount info
- Server-side tracking — Downloads are tracked server-side for accuracy (not just click handlers)
- GA4 Measurement Protocol — Optional server-to-server event delivery for downloads and refunds
- Per-event toggles — Enable or disable each event type independently
- GTM Environment support — Use
gtm_auth and gtm_preview parameters for staging/production environments
- Debug mode — Log all events to browser console and PHP error log for troubleshooting
- Graceful degradation — Download and user tracking work with core Download Manager; e-commerce events activate when Premium Packages is installed
- No coding required — Configure everything from the settings page
Requirements
- WordPress Download Manager (core plugin)
- WordPress Download Manager — Premium Packages (for e-commerce events)
- A Google Tag Manager account with a container
- A Google Analytics 4 property (connected to GTM)
Setup Instructions
Step 1: Install and Activate
- Download and install the WPDM - Google Tags add-on
- Go to WordPress Admin → Plugins and activate it
- If upgrading from v1.x, your existing GTM Container ID will be automatically migrated
Step 2: Configure the Plugin
- Go to Download Manager → Settings → Google Tags
- Enter your GTM Container ID (e.g.,
GTM-XXXXXXX)
- (Optional) If using GTM environments, enter the gtm_auth and gtm_preview parameters
- Under E-commerce Tracking, check the events you want to track (all are enabled by default)
- Under Other Events, enable Download, Signup, and Login tracking as needed
- Click Save Changes
Step 3: Configure Google Tag Manager
In your GTM container, create the following tags to forward events to GA4:
- Go to Google Tag Manager → your container
- Create a Google Tag (GA4 Configuration):
- Tag Type: Google Tag
- Tag ID: Your GA4 Measurement ID (e.g.,
G-XXXXXXXXXX)
- Trigger: All Pages
- Create GA4 Event tags for each event you want to track:
- Tag Type: Google Analytics: GA4 Event
- Measurement ID: Your GA4 Measurement ID
- Event Name: Use the event name from the dataLayer (e.g.,
view_item, add_to_cart, purchase)
- Check "Send Ecommerce data" under More Settings → Ecommerce
- Trigger: Create a Custom Event trigger matching the event name
- Publish your GTM container
Recommended GA4 Event Tags to Create:
| Tag Name |
Event Name |
Trigger (Custom Event) |
| GA4 - View Item |
view_item |
view_item |
| GA4 - Add to Cart |
add_to_cart |
add_to_cart |
| GA4 - Remove from Cart |
remove_from_cart |
remove_from_cart |
| GA4 - View Cart |
view_cart |
view_cart |
| GA4 - Begin Checkout |
begin_checkout |
begin_checkout |
| GA4 - Add Payment Info |
add_payment_info |
add_payment_info |
| GA4 - Purchase |
purchase |
purchase |
| GA4 - Refund |
refund |
refund |
| GA4 - File Download |
file_download |
file_download |
| GA4 - Sign Up |
sign_up |
sign_up |
| GA4 - Login |
login |
login |
Step 4: Set Up GA4 Measurement Protocol (Optional)
For the most reliable download and refund tracking, configure the GA4 Measurement Protocol. This sends events directly from your server to GA4, independent of the browser.
- Go to Google Analytics → Admin → Data Streams
- Click on your web data stream
- Scroll down and click Measurement Protocol API secrets
- Click Create to generate a new API secret
- Copy the secret value
- In your WordPress admin, go to Download Manager → Settings → Google Tags
- Enter your GA4 Measurement ID (e.g.,
G-XXXXXXXXXX)
- Enter the API Secret you just created
- Click Save Changes
Step 5: Verify Tracking
- Enable Debug Mode in the plugin settings
- Open your site in a browser and open the browser console (F12 → Console)
- You should see
[WPDM GTags] Debug mode enabled in the console
- Navigate to a package page — you should see a
view_item event logged
- Add an item to cart — you should see an
add_to_cart event
- Complete a test purchase — you should see
begin_checkout and purchase events
- You can also use GTM Preview mode (in Google Tag Manager, click Preview) to see events firing in real time
- In GA4, go to Reports → Realtime to confirm events are arriving
- Once verified, disable Debug Mode for production
Step 6: View Reports in GA4
Once tracking is active, your GA4 property will start populating e-commerce reports:
- Monetization → Overview — Revenue, purchases, and average purchase value
- Monetization → E-commerce purchases — Detailed product performance
- Monetization → Purchase journey — Funnel from view_item → add_to_cart → begin_checkout → purchase
- Engagement → Events — All tracked events with counts
- Realtime — Live event monitoring for verification
Troubleshooting
- Events not showing in GA4? — Enable Debug Mode and check the browser console. Ensure your GTM container is published and the GA4 tags have the correct Measurement ID.
- E-commerce events not firing? — E-commerce events (cart, checkout, purchase) require the Premium Packages add-on to be active.
- Download events delayed? — Download events appear on the next page load after the download starts. For immediate tracking, configure the GA4 Measurement Protocol (Step 4).
- Purchase data missing? — Make sure your GA4 Event tags in GTM have "Send Ecommerce data" enabled.
- Duplicate events? — If you have other GTM/GA4 plugins active, they may cause duplicate event tracking. Use only one GTM integration plugin.
Data Reference
Each e-commerce event includes the following item-level data:
| Parameter |
Description |
item_id |
Product code (SKU) or package ID |
item_name |
Package title |
price |
Effective price (sale price if active, otherwise base price) |
quantity |
Quantity in cart/order |
item_category |
Primary download category |
item_variant |
License type (if applicable) |
discount |
Discount amount (if on sale) |
coupon |
Coupon code (for purchase events) |
The purchase event additionally includes: transaction_id, value (order total), tax, currency, and coupon.