Target Audience Plugin Documentation

Getting Started

Plugin Overview

Target Audience Pro is a powerful WordPress plugin designed to provide granular content targeting and personalization.

Core Features

  • Precise Geographic Targeting
  • Device and Browser Detection
  • Operating System Identification
  • User Role-Based Access Control
  • Language and Localization Filtering
  • Time and Date-Based Content Scheduling
  • UTM and Affiliate Tracking

Installation

System Requirements

  • WordPress 4.5 or higher
  • PHP 5.6 or higher
  • Tested up to WordPress 6.6.2

Installation Steps

  1. Upload plugin files to /wp-content/plugins/target-audience directory
  2. Activate the plugin through WordPress Plugins screen
  3. Navigate to Settings > Target Audience to configure

Targeting Capabilities

Comprehensive Detection Mechanisms

Detection TypeSupported Options
Geographic TargetingCountry-level detection with multiple fallback services
Operating SystemsWindows, macOS, iOS, Android, Linux, ChromeOS
BrowsersChrome, Firefox, Safari, Edge, Opera, Internet Explorer
Device TypesDesktop, Mobile, Tablet

Detection Accuracy

  • Multiple geolocation service fallback
  • 1-hour caching for performance
  • Cloudflare GeoIP header support

Shortcode Attributes

AttributeDescriptionExample
countryInclude specific countriescountry="US,CA"
not-countryExclude specific countriesnot-country="FR,DE"
deviceTarget device typesdevice="mobile,tablet"
osTarget operating systemsos="Windows,Android"
roleTarget user rolesrole="subscriber,customer"
start_date/end_dateContent schedulingstart_date="2024-01-01"
utm_source/utm_medium/utm_campaignUTM tracking parametersutm_source="newsletter"

Usage Examples

Basic Targeting

[_ta country="US,CA"]Content for North American users[/_ta]

Advanced Targeting

[_ta 
    country="US" 
    device="mobile" 
    role="subscriber" 
    utm_source="mobile_campaign"
]Mobile subscriber content for US users[/_ta]

Custom Post Type for Shortcodes

Manage and store your shortcodes with a dedicated custom post type.

  • Navigate to Target Audience > Shortcodes
  • Create, edit, and manage shortcodes
  • Searchable taxonomies for easy management

Testing and Debugging

Shortcode Testing Page

Use the built-in testing page to validate shortcode targeting:

  • Go to Target Audience > Test Shortcodes
  • View current user’s detected attributes
  • Test shortcode visibility conditions

Debugging Attributes

[_ta debug="true"]Check targeting conditions[/_ta]

Advanced Targeting Features

Geolocation Services

Multiple fallback services for reliable country detection:

  • Cloudflare GeoIP Header (Primary)
  • GeoJS Service
  • Really Free GeoIP
  • freegeoip.app
  • db-ip.com
  • ipapi.co

Operating System Detection

Precise OS detection for:

  • Windows (NT, Win32, Win64)
  • macOS (Macintosh, Mac OS X, PowerPC)
  • iOS (iPhone, iPad, iPod)
  • Android
  • Linux
  • ChromeOS
  • Unix (X11)

Browser Detection

Supported browsers with version detection:

  • Google Chrome
  • Mozilla Firefox
  • Safari
  • Microsoft Edge
  • Opera
  • Internet Explorer

Tag Generator

Available Targeting Options

  • Country Targeting
    • Include specific countries
    • Exclude specific countries
  • Device Targeting
    • Include device types
    • Exclude device types
  • Language Targeting
    • Include languages
    • Exclude languages
  • OS Targeting
    • Include operating systems
    • Exclude operating systems
  • Browser Targeting
    • Include browsers
    • Exclude browsers
  • Role Targeting
    • Include user roles
    • Exclude user roles
  • Time-Based Targeting
    • Date range (start_date, end_date)
    • Time schedule (start_time, end_time)
    • Day of week targeting

Tracking Parameters

  • UTM Parameters
    • utm_source
    • utm_medium
    • utm_campaign
    • utm_term
    • utm_content
  • Affiliate Tracking
    • Custom affiliate parameters
    • Multiple tracking IDs

Shortcode Reference

Supported Shortcode Formats

  • content
     (Recommended)
  • [ta]content[/ta]
  • [target_audience]content[/target_audience]

Advanced Shortcode Examples

[_ta 
    country="US,CA" 
    not-country="GB" 
    device="mobile,tablet" 
    os="Android,iOS" 
    lang="en" 
    start_date="2024-01-01" 
    end_date="2024-12-31" 
    utm_source="newsletter" 
    utm_campaign="summer2024"
]
    Your targeted content here
[/_ta]

Negative Targeting

Exclude specific criteria using not- prefix:

  • not-country
  • not-device
  • not-os
  • not-browser
  • not-role
  • not-lang

Caching and Performance

Geolocation Caching

  • 1-hour cache duration for IP-based detection
  • Automatic cache invalidation
  • Fallback service rotation

Performance Optimizations

  • Lightweight detection algorithms
  • Minimal database queries
  • Efficient shortcode processing
  • Optimized JavaScript loading

Performance Optimization

  • Minimal database queries
  • 1-hour geolocation caching
  • Lightweight detection algorithms
  • Efficient shortcode processing

Banner and Content Display

Banner Attributes

  • banner_image – URL of the banner image
  • banner_link – Clickable URL for the banner
  • banner_text – Text overlay for the banner
  • banner_type – Display style (in-page, modal, floating)

Content Rendering

Content can be rendered in multiple formats:

  • Standard content with shortcodes
  • Banner with image and link
  • Mixed content with HTML and media

Debug and Preview Modes

Debug Mode

Enable debug mode to see detailed targeting information:

[_ta debug="true"]Content[/_ta]

Debug output includes:

  • Current date/time values
  • User roles and permissions
  • Detected language settings
  • OS and browser information
  • Device type detection
  • Geolocation data and source

Preview Mode

Use preview mode to bypass all targeting rules:

[_ta preview="true"]Content[/_ta]

Note: Preview mode only works for users with edit_posts capability.

Tag Generator Interface

Interface Components

  • Title SectionName your shortcode for easy reference
  • Content EditorFull WordPress editor with media support
  • Tag Options
    • Location selector with country list
    • Device type selection
    • Operating system targeting
    • Browser selection
    • Language options
    • User role targeting
  • Preview SectionLive preview of your targeted content

Using the Tag Generator

  1. Enter a title for your shortcode
  2. Add your content using the WordPress editor
  3. Select targeting options from the available tags
  4. Preview your content with the selected targeting
  5. Copy the generated shortcode or save it for later use

Advanced Tracking Features

UTM Tracking

Comprehensive UTM parameter support:

  • utm_source – Traffic source identifier
  • utm_medium – Marketing medium
  • utm_campaign – Campaign name
  • utm_term – Paid keywords
  • utm_content – Content differentiator

Affiliate Tracking

Flexible affiliate tracking options:

  • affiliate_id – Unique affiliate identifier
  • affiliate_id_param – Custom parameter name

Example Tracking Implementation

[_ta 
    utm_source="newsletter" 
    utm_medium="email" 
    utm_campaign="summer2024" 
    affiliate_id="AFF123" 
    affiliate_id_param="ref"
]
    Your tracked content here
[/_ta]

Compatibility and Integration

WordPress Integration

  • Full Gutenberg editor support
  • Classic editor integration
  • Widget area compatibility
  • Theme template support

Plugin Compatibility

  • Page builders (Elementor, Divi, etc.)
  • Caching plugins
  • SEO plugins
  • Analytics integration

Server Requirements

  • PHP 7.3 or higher
  • WordPress 5.2 or higher
  • MySQL 5.6 or higher

Frequently Asked Questions

Can I combine multiple targeting attributes?

Yes, you can combine multiple attributes to create precise targeting rules.

How accurate is the geolocation detection?

We use multiple fallback services to ensure high accuracy in location detection.

What happens if no targeting conditions match?

Content will not be displayed if no targeting conditions are met.