Docs / PixelYourSite Pro / Configuration: Pixels & APIs / Google Tag Manager

Google Tag Manager

Last updated: June 8, 2026

Where to find it: in the PYS admin, PixelYourSite Pro → Dashboard → GTM Tag card.

PixelYourSite pushes every tracked event into a GTM dataLayer. You can run all your tracking through Google Tag Manager instead of the plugin’s native tags by enabling GTM here and importing the container file PYS ships.

Google Tag Manager with PixelYourSite: Learn How to Track Everything on WordPress

Play the video

Google Tag Manager with PixelYourSite: Learn How to Track Everything on WordPress

Two ways to run GTM with PixelYourSite

ModeWhat PYS doesWhen to use it
PYS loads GTMLoads the GTM container script and pushes events to the data layer.The simplest path. You don’t have GTM running already.
Data layer onlyPushes events to the data layer. The GTM script is loaded by your theme, another plugin, or your own snippet.GTM is already on the site through another tool, and you only want PYS to feed it data.

The mode is controlled by the Send just the data layer toggle in the GTM Tag card.

Settings

Enable GTM

Turns the GTM integration on or off for the whole site.

GTM Tag (Container ID)

Paste your Container ID, format GTM-XXXXXXX. Find it in the GTM workspace header or in Admin → Container Settings.

Send just the data layer

When on, PYS pushes events to dataLayer but does not load the GTM container script. Use this if GTM is already loaded by your theme or another plugin.

When off (default), PYS loads the GTM script in addition to pushing events.

Fire the active automated events for this pixel

Sends PYS’s automated events (PageView, ViewContent, Lead, AddToCart, video, scroll, time on page, etc.) to GTM as data layer pushes.

Fire the WooCommerce events for this pixel

Sends WooCommerce events (ViewContent, AddToCart, InitiateCheckout, Purchase, plus Advanced Marketing events) to GTM.

Fire the Easy Digital Downloads events for this pixel

Sends EDD events (ViewContent, AddToCart, Purchase, plus EDD-specific events) to GTM.

If any of these three toggles is off, those events still fire on the native PYS pixels but don’t reach GTM.

Don’t duplicate tags

If a platform (GA4, Meta, Google Ads, Bing, Pinterest, TikTok, Reddit) is configured in PYS’s native settings and also fired from a tag in GTM, every event ships twice.

Pick one delivery path per platform:

  • Run the tag through GTM → disable that platform’s native integration in PYS.
  • Run the tag through PYS → don’t add it to GTM.

The exception is Send just the data layer: when that’s on, PYS only feeds the data layer, so duplicates can only come from your own GTM tags.

Display conditions (Super Pack)

Limit where GTM fires:

  • Logic: Track (default) or Don’t track.
  • Scope: entire site, or a subset.
  • Add Extra Condition for advanced targeting.

This setting is part of the Super Pack add-on.

Hide rules (Super Pack)

Block GTM from firing based on URLs:

  • Hide this tag if the URL includes — blocks specific pages.
  • Hide this tag if the landing URL includes — blocks the whole session based on the entry URL parameters.
  • Hide for X hours — temporary suppression.

This setting is part of the Super Pack add-on.

GTM Container Import

PYS ships a pre-built container file you can import to skip the manual GTM setup. Importing it gives the container all the triggers and variables it needs to read PYS’s data layer, plus a ready GA4 base tag and four empty folders for GA4 event tags.

Google Tag Manager with PixelYourSite: Import GTM Container with GA4 support

Play the video

Google Tag Manager with PixelYourSite: Import GTM Container with GA4 support

What’s in the file

The shipped file is GTM-PYS-v1-1.json (GTM Container Version 1.1).

Tags

  • GA4 - Base - Tag — a Google Tag fired on every page, using the {{GA4 ID}} variable as its Measurement ID.
  • Empty folders for the event tags you’ll add: GA4 PYS Automated Events, GA4 PYS Custom Event, GA4 PYS Ecommerce Events, GA4 PYS Advanced Marketing Events.

Triggers

  • PYS Automated Events — PageView, ViewContent, Lead, AddToCart, and the rest.
  • PYS Ecommerce Events — WooCommerce and EDD events.
  • PYS Advanced Marketing Events — Frequent Shopper, VIP Client, Big Whale, First-Time Buyer, Returning Customer.
  • PYS Manual Events — Custom Events you build in PYS.

Variables

  • GA4 ID — the only one you have to edit. Set it to your G-XXXXXXXXXX Measurement ID.
  • Standard PYS parameters: event_id, event_url, event_day, event_hour, event_month, landing_page, traffic_source, page_title, post_id, post_type, plugin.
  • Event-specific parameters: download_url, download_type, download_name, form_id, text, target_url, search_term, progress.
  • Custom parameter pairs: Custom_Parameter_One…Custom_Parameter_Five with their _Value counterparts.

The shipped tags cover GA4 only. To run Meta, Google Ads, Bing, Pinterest, TikTok, or Reddit through GTM, add those tags yourself using the included triggers and variables.

Import steps

1. Download the file. PixelYourSite Pro → Dashboard → GTM Tag → GTM Container Import → GTM Container Version 1.1.

2. Create a GTM container if you don’t have one. In GTM: Admin → Create Container, name it, target Web, save. You’ll get a GTM-XXXXXXX ID.

3. Import the file. In your GTM workspace: Admin → Container → Import Container.

  • Choose container file: GTM-PYS-v1-1.json.
  • Choose workspace: New for a fresh import, or Existing to merge into your current workspace.
  • Choose import option: Merge → Overwrite conflicting tags, triggers, and variables. Use Rename instead if you have items with the same names and want to keep both.

Review the import summary, then confirm.

4. Set your GA4 ID. In GTM: Variables → User-Defined Variables → GA4 ID. Enter your G-XXXXXXXXXX Measurement ID. Save.

5. Publish. Click Submit in the top right, add a version name, Publish.

6. Paste the Container ID in PYS. Back in WordPress, in the GTM Tag card: enter GTM-XXXXXXX in Container ID. Save.

7. Verify with GTM Preview. In GTM: Preview. Open your site, browse around, and check the Variables and Data Layer tabs. PYS events should appear with their parameters populated.

Updating to a newer container version

When PYS ships a newer file (e.g. v1.2):

  1. Download the new file from the same GTM Tag card.
  2. In GTM, create a new workspace so you can preview safely.
  3. Admin → Container → Import Container → choose the new file → Existing workspace (the new one) → Merge → Overwrite conflicting.
  4. Preview, verify, publish.

Your GA4 ID value is preserved by Overwrite conflicting.

Troubleshooting

  • No PYS events in GTM Preview. Check that GTM is enabled in the GTM Tag card and the Container ID matches the one you published. If Send just the data layer is on, confirm your theme or another plugin actually loads the GTM script on the page.
  • GA4 events don’t reach GA4. Open GA4 – Base – Tag in GTM. The tagId field should resolve to your Measurement ID at preview time. If it shows the literal {{GA4 ID}}, the variable is empty — fix it in User-Defined Variables → GA4 ID.
  • Duplicate events in GA4. Either GA4 is loaded twice (PYS native + GTM), or two GA4 tags fire on the same event. Disable the PYS native GA4 integration if you’re running GA4 through GTM, or remove the duplicate tag in GTM.
  • Custom Event parameters not showing. The container has five custom parameter slots. If an event sends more than five parameters, add additional Custom_Parameter_Six (etc.) variables in GTM using the same Data Layer Variable pattern.
  • Ecommerce items missing. The standard GA4 ecommerce variables read ecommerce.items from the data layer. WooCommerce and EDD events populate it automatically; if another plugin or theme clears the ecommerce object before the GA4 tag fires, the items are lost.
  • One event group isn’t sent. Check the three event-group toggles: Fire active automated events, Fire WooCommerce events, Fire EDD events. Each one gates a group independently.