Google Tag Manager Specialized for Publishers

Integrate Google Tag Manager into WordPress and generate an advanced, customizable dataLayer for publishers, blogs, and digital media. Get detailed insights about reader behavior and maximize your monetization.

15+

dataLayer Parameters

5 min

Initial Configuration

0

Manual Code Lines

100%

Free

Main Features

Everything you need for advanced content tracking

Advanced dataLayer

Automatically generates a complete dataLayer with detailed information about content: hierarchical categories, tags, author, format, multimedia, and more.

Flexible Configuration

Customize separators, CSS selectors, event names, and parameters according to the specific needs of your website.

Premium Content

Mark posts as premium or evergreen directly from the WordPress editor. Differentiated tracking for monetization.

Pre-configured GTM Container

Download a complete Google Tag Manager container with view_post and read_post events already configured and ready to use.

read_post configurable: 30s + 90% scroll by default
Automatic Detection

Automatically detects multimedia, reading time, used editor, and traffic origin without manual configuration.

Detected editors:
Elementor, Divi, WP Bakery, Gutenberg
Secure and Optimized

Optimized code for performance, data validation, security nonces, and full compatibility with WordPress.

Why Choose GTM4Publishers?

Exclusive advantages for content sites

Configuration in 5 minutes

Set up, configure, and start tracking your content in just 5 minutes. No technical complications at all.

Detailed Insights

Get granular, actionable data about your readers' behavior and engagement with every piece of content.

Customizable Events

Easily adjust the read_post event in GTM: set your own time (30s) and scroll (90%) thresholds for engagement.

Maximize Earnings

Boost your monetization strategy with precise, real-time data about premium and evergreen content.

Advanced Analytics Ready

Seamlessly integrates with Google Analytics 4 and BigQuery for advanced, custom content performance analysis.

No Manual Code

Everything is generated automatically by the plugin. No need to write or maintain any manual code.

Compatible with Any Theme

Works with all WordPress themes. Use customizable CSS selectors to adapt to any design or layout.

Community Support

Join our active Telegram group to get help, share experiences, and connect with other publishers worldwide.

Automatic Editor Detection

Analyze which editor generates better engagement

Elementor

Detects posts created with Elementor Page Builder

Divi

Detects posts created with Divi Builder

WP Bakery

Detects posts created with WP Bakery Page Builder

Gutenberg

Detects posts created with the native block editor

Benefits of Editor Detection
  • Analyze which editor generates better engagement
  • Optimize content based on the used editor
  • Identify usage patterns of different editors
  • Improve content strategy based on preferred editor
dataLayer Parameter: gtm4pubs_editor - Contains the detected editor name (elementor, divi, wp_bakery, gutenberg, other)

Example of Generated dataLayer

See how tracking works in action

{
  "event": "view_post_ready",
  "gtm4pubs_categories": "technology>artificial-inteligence|marketing>analytics",
  "gtm4pubs_tags": "ai,chatgpt,productivity,tools",
  "gtm4pubs_author_id": 1,
  "gtm4pubs_post_id": 1234,
  "gtm4pubs_format": "standard",
  "gtm4pubs_multimedia": "image,video,gallery",
  "gtm4pubs_word_count": 2500,
  "gtm4pubs_reading_time": 13,
  "gtm4pubs_publication_date": "2024-01-15",
  "gtm4pubs_update_date": "2024-01-20",
  "gtm4pubs_sticky": 0,
  "gtm4pubs_origin": "category",
  "gtm4pubs_access": "premium",
  "gtm4pubs_evergreen": 1,
  "gtm4pubs_comments_count": 45,
  "gtm4pubs_editor": "gutenberg",
  "gtm4pubs_related": 1
}

This dataLayer is generated automatically on each individual post page

Pricing

Complete access without hidden costs

Completely Free

0€

Forever

  • All features included
  • No usage limits
  • Free updates
  • Community support
  • Open source code
Download Now

Frequently Asked Questions

Find answers to common questions and see advanced BigQuery analysis examples

  1. Download the plugin from WordPress.org or upload the ZIP file to your WordPress admin
  2. Go to Plugins > Add New > Upload Plugin
  3. Upload the GTM4Publishers ZIP file and click "Install Now"
  4. Activate the plugin from the Plugins page
  5. Go to Settings > GTM4Publishers to configure the plugin
  6. Download the pre-configured GTM container and import it to your Google Tag Manager

Note: The plugin requires WordPress 5.0+ and PHP 7.4+.

Yes, you can configure the CSS selectors to adapt the plugin to any theme.

Yes, it automatically detects posts created with Elementor, Divi, WP Bakery Page Builder, Gutenberg, and others.

  1. Download the pre-configured GTM container from the plugin settings
  2. Go to your Google Tag Manager account
  3. Click on "Admin" > "Import Container"
  4. Upload the downloaded JSON file
  5. Choose "Merge" to add the new tags, triggers, and variables to your existing container
  6. Review the imported elements and publish your container

Important: The container includes view_post and read_post events with all necessary variables mapped to your dataLayer.

After importing the provided GTM container, make sure your GA4 tags are set up to use the variables from the dataLayer (such as categories, tags, access, evergreen, etc.). You can map these variables in your GA4 configuration tag or in custom events. The included container already provides a recommended setup for most publishers.

  1. Go to your Google Analytics 4 property
  2. Navigate to Configure > Custom Definitions
  3. Click "Create Custom Dimensions"
  4. Add the following dimensions:
    • Post Category - Scope: Event, Parameter: gtm4pubs_categories
    • Post Tags - Scope: Event, Parameter: gtm4pubs_tags
    • Content Access - Scope: Event, Parameter: gtm4pubs_access
    • Content Type - Scope: Event, Parameter: gtm4pubs_evergreen
    • Editor Used - Scope: Event, Parameter: gtm4pubs_editor
    • Read Time - Scope: Event, Parameter: gtm4pubs_read_time
    • Post Author - Scope: Event, Parameter: gtm4pubs_author
    • Post Format - Scope: Event, Parameter: gtm4pubs_format
    • Multimedia Content - Scope: Event, Parameter: gtm4pubs_multimedia
    • Word Count - Scope: Event, Parameter: gtm4pubs_word_count
    • Comment Count - Scope: Event, Parameter: gtm4pubs_comment_count
    • Publication Date - Scope: Event, Parameter: gtm4pubs_publication_date
    • Update Date - Scope: Event, Parameter: gtm4pubs_update_date
    • Sticky Post - Scope: Event, Parameter: gtm4pubs_sticky
    • Related Posts - Scope: Event, Parameter: gtm4pubs_related
    • Traffic Source - Scope: Event, Parameter: gtm4pubs_traffic_source
    • Post ID - Scope: Event, Parameter: gtm4pubs_post_id
    • Author ID - Scope: Event, Parameter: gtm4pubs_author_id
  5. Save and wait 24-48 hours for data to populate

Yes, you can choose to only generate the dataLayer and insert the GTM code manually if you prefer.

You can adjust the time and scroll conditions in your GTM container triggers.

GTM4Publishers is designed to work alongside other Tag Manager plugins, but there are some considerations:

  • Compatible: Works well with most GTM plugins that don't interfere with the dataLayer
  • Potential conflicts: May conflict with plugins that modify the same dataLayer variables
  • Recommendation: Test in a staging environment first if using multiple GTM plugins
  • Alternative: You can use only the dataLayer generation and handle GTM setup manually

Note: The plugin uses unique variable names (gtm4pubs_*) to minimize conflicts with other plugins.

Yes, it includes English, Spanish, and Russian translations and is fully compatible with WordPress translation tools.

Yes! The plugin is designed to work perfectly with Google Analytics 4 and BigQuery. Once you have GA4 exporting data to BigQuery, you can use the dataLayer parameters (like categories, access, editor, etc.) for advanced analysis.

Yes! The plugin is designed to work perfectly with Google Analytics 4 and BigQuery. Once you have GA4 exporting data to BigQuery, you can use the dataLayer parameters (like categories, access, editor, etc.) for advanced analysis.

Below you'll find a comprehensive collection of BigQuery example queries that cover:

  • Content performance analysis by category and tags
  • Traffic source engagement analysis
  • Multimedia content performance comparison
  • Editor performance analysis (Elementor, Divi, WP Bakery, Gutenberg)
  • Premium vs public content engagement
  • Evergreen content performance
  • Device type engagement analysis

These queries are ready to use and will help you gain valuable insights into your content performance and user behavior.

Yes, if you enable the "Delete all data on uninstall" option, all plugin settings and custom fields will be removed using only the WordPress API (no direct database queries). If you leave this option unchecked, your data will be preserved for future use or reinstallation.

BigQuery Example Queries

1. Engagement Analysis by Category

Analyze which content categories generate the most engagement and read events.

SELECT 
  REGEXP_EXTRACT(event_params.value.string_value, r'([^>]+)$') as main_category,
  COUNT(CASE WHEN event_name = 'view_post' THEN 1 END) as views,
  COUNT(CASE WHEN event_name = 'read_post' THEN 1 END) as reads,
  ROUND(COUNT(CASE WHEN event_name = 'read_post' THEN 1 END) * 100.0 / 
        COUNT(CASE WHEN event_name = 'view_post' THEN 1 END), 2) as engagement_rate
FROM `your-project.analytics_123456789.events_*`,
UNNEST(event_params) as event_params
WHERE event_params.key = 'gtm4pubs_categories'
  AND _TABLE_SUFFIX >= FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY))
GROUP BY main_category
ORDER BY engagement_rate DESC
2. Premium vs Public Content Performance

Compare engagement rates between premium and public content to optimize monetization strategy.

SELECT
  event_params.value.string_value as access_type,
  COUNT(CASE WHEN event_name = 'view_post' THEN 1 END) as views,
  COUNT(CASE WHEN event_name = 'read_post' THEN 1 END) as reads,
  ROUND(COUNT(CASE WHEN event_name = 'read_post' THEN 1 END) * 100.0 /
        COUNT(CASE WHEN event_name = 'view_post' THEN 1 END), 2) as engagement_rate
FROM `your-project.analytics_123456789.events_*`,
UNNEST(event_params) as event_params
WHERE event_params.key = 'gtm4pubs_access'
  AND _TABLE_SUFFIX >= FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY))
GROUP BY access_type
ORDER BY engagement_rate DESC
3. Editor Performance Analysis

Compare which content editor (Elementor, Divi, WP Bakery, Gutenberg) generates better user engagement.

SELECT
  event_params.value.string_value as editor,
  COUNT(CASE WHEN event_name = 'view_post' THEN 1 END) as views,
  COUNT(CASE WHEN event_name = 'read_post' THEN 1 END) as reads,
  ROUND(COUNT(CASE WHEN event_name = 'read_post' THEN 1 END) * 100.0 /
        COUNT(CASE WHEN event_name = 'view_post' THEN 1 END), 2) as engagement_rate
FROM `your-project.analytics_123456789.events_*`,
UNNEST(event_params) as event_params
WHERE event_params.key = 'gtm4pubs_editor'
  AND _TABLE_SUFFIX >= FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY))
GROUP BY editor
ORDER BY engagement_rate DESC
4. Evergreen Content Engagement

Analyze the performance of evergreen content compared to time-sensitive content.

SELECT
  event_params.value.string_value as evergreen,
  COUNT(CASE WHEN event_name = 'view_post' THEN 1 END) as views,
  COUNT(CASE WHEN event_name = 'read_post' THEN 1 END) as reads,
  ROUND(COUNT(CASE WHEN event_name = 'read_post' THEN 1 END) * 100.0 /
        COUNT(CASE WHEN event_name = 'view_post' THEN 1 END), 2) as engagement_rate
FROM `your-project.analytics_123456789.events_*`,
UNNEST(event_params) as event_params
WHERE event_params.key = 'gtm4pubs_evergreen'
  AND _TABLE_SUFFIX >= FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY))
GROUP BY evergreen
ORDER BY engagement_rate DESC
5. Traffic Source Engagement Analysis

Identify which traffic sources bring the most engaged users by calculating engagement rates.

SELECT 
  traffic_source,
  COUNT(*) as total_sessions,
  COUNT(CASE WHEN event_name = 'read_post' THEN 1 END) as read_events,
  ROUND(COUNT(CASE WHEN event_name = 'read_post' THEN 1 END) / COUNT(*) * 100, 2) as engagement_rate
FROM `your-project.analytics_123456789.events_*`
WHERE event_name IN ('page_view', 'read_post')
  AND _TABLE_SUFFIX >= FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY))
GROUP BY traffic_source
HAVING total_sessions > 100
ORDER BY engagement_rate DESC
6. Multimedia Content Performance

Compare how different types of multimedia content perform in terms of user engagement.

SELECT 
  event_params.value.string_value as post_type,
  COUNT(CASE WHEN event_params.value.string_value = 'true' THEN 1 END) as has_video,
  COUNT(CASE WHEN event_params.value.string_value = 'true' THEN 1 END) as has_audio,
  COUNT(CASE WHEN event_params.value.string_value = 'true' THEN 1 END) as has_gallery,
  COUNT(*) as total_posts,
  AVG(read_time) as avg_read_time,
  COUNT(CASE WHEN event_name = 'read_post' THEN 1 END) as total_reads
FROM `your-project.analytics_123456789.events_*`,
UNNEST(event_params) as event_params
WHERE event_name = 'read_post'
  AND event_params.key IN ('gtm4pubs_has_video', 'gtm4pubs_has_audio', 'gtm4pubs_has_gallery')
  AND _TABLE_SUFFIX >= FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY))
GROUP BY post_type, has_video, has_audio, has_gallery
ORDER BY avg_read_time DESC
7. Tag Performance Analysis

Find the most engaging tags to understand what topics resonate best with your audience.

SELECT 
  event_params.value.string_value as post_tags,
  COUNT(*) as total_posts,
  AVG(read_time) as avg_read_time,
  COUNT(CASE WHEN event_name = 'read_post' THEN 1 END) as total_reads
FROM `your-project.analytics_123456789.events_*`,
UNNEST(event_params) as event_params
WHERE event_name = 'read_post'
  AND event_params.key = 'gtm4pubs_tags'
  AND event_params.value.string_value IS NOT NULL
  AND _TABLE_SUFFIX >= FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY))
GROUP BY post_tags
ORDER BY avg_read_time DESC
LIMIT 15
8. Device Type Engagement

Understand how user engagement varies across different device types.

SELECT 
  device.category as device_type,
  COUNT(*) as total_sessions,
  AVG(read_time) as avg_read_time,
  COUNT(CASE WHEN event_name = 'read_post' THEN 1 END) as read_events
FROM `your-project.analytics_123456789.events_*`
WHERE event_name IN ('page_view', 'read_post')
  AND _TABLE_SUFFIX >= FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY))
GROUP BY device_type
ORDER BY avg_read_time DESC

What Users Say

Real experiences from publishers

María García
Marketing Blog

"GTM4Publishers revolutionized our tracking. In 5 minutes we had a complete dataLayer that gave us insights we'd never had before."

Carlos Rodríguez
News Portal

"Automatic content premium detection allowed us to optimize our monetization strategy. The data is incredibly accurate."

Ana López
Technology Blog

"The pre-configured GTM container saved us hours of work. Everything worked perfectly from the first moment."

Advanced Services for Publishers

Need personalized help, training, or consulting to get the most out of GTM4Publishers and your analytics?

  • Custom Training: Courses and workshops tailored to your level and needs.
  • Advanced Technical Support: Troubleshooting, advanced setup, and optimization.
  • Strategic Consulting: Analytics audits, monetization recommendations, and KPI improvement.
  • BigQuery & Advanced Analysis: Data integration and custom reporting.

Love GTM4Publishers?

This plugin is completely free, but your support helps us dedicate more time to:

New Features

Advanced analytics and tracking capabilities

Better Support

Faster responses and detailed assistance

Performance

Optimizations and speed improvements

Every contribution, no matter how small, makes a difference!

Buy Me a Coffee

Ready to Optimize Your Tracking?

Join hundreds of publishers who are already getting valuable insights with GTM4Publishers