Business and enterprise integrations for Data Machine.
This plugin extends Data Machine with business-focused integrations including:
- Google Search: Search the web through Google Custom Search API as an AI tool
- Google Sheets: Fetch data from spreadsheets and append data for reporting
- PageSpeed Insights: Run Lighthouse audits for performance, SEO, accessibility, and optimization opportunities
- Google Analytics (GA4): Fetch visitor analytics, realtime, engagement, and comparison metrics
- Google Search Console: Read search analytics, inspect URLs, and manage sitemaps
- Slack: Post messages and fetch conversations from channels
- Discord: Post messages and fetch messages from server channels
- Amazon Affiliate Link: Search Amazon products and return affiliate links using the Amazon Creators API
- Bing Webmaster Tools: Fetch Bing search, traffic, page, and crawl analytics
- WordPress 6.9+
- PHP 8.2+
- Data Machine core plugin (required)
- Install and activate Data Machine core plugin
- Upload and activate this plugin
- Configure Google Sheets authentication in Data Machine settings
- Create flows using the Google Sheets handlers
Data Machine Business registers the google_search AI tool for chat and pipeline contexts. It uses the Google Custom Search API endpoint and the same datamachine_search_config site option previously used by Data Machine core, so existing saved API keys and Custom Search Engine IDs continue to work after this plugin is activated.
- Go to Google Cloud Console
- Enable the Custom Search API for your project
- Create or select an API key with access to the Custom Search API
- Create a Programmable Search Engine and copy its Search Engine ID
- Save the API key and Search Engine ID in Data Machine tool settings for
google_search
The tool accepts a required query parameter and an optional site_restrict domain. It returns up to 10 structured results with title, link, snippet, and display link fields.
Data Machine Business registers the datamachine/google-analytics ability and google_analytics chat/pipeline tool. Data Machine core keeps the compatible REST and WP-CLI dispatchers (/analytics/ga and wp datamachine analytics ga), which work when this plugin is active.
Existing Data Machine GA4 settings are adopted automatically because this plugin uses the same option key, datamachine_ga_config, and token transient, datamachine_ga_access_token.
- Go to Google Cloud Console
- Enable the Google Analytics Data API
- Create a service account and download its JSON key
- Grant the service account access to the GA4 property
- Configure the Service Account JSON and GA4 Property ID in Data Machine tool settings
datamachine/google-analytics— Fetches GA4 reports and realtime analyticsgoogle_analytics— Chat and pipeline tool wrapper for AI agents
Supported actions include page_stats, traffic_sources, date_stats, realtime, top_events, user_demographics, landing_pages, engagement, and new_vs_returning.
- Go to Google Cloud Console
- Create a new project or select existing
- Enable the Google Sheets API
- Create OAuth 2.0 credentials (Web application type)
- Add your site's URL as authorized redirect URI
- Copy Client ID and Client Secret to Data Machine settings
- Authenticate the handler
PageSpeed Insights runs Google Lighthouse audits against any URL. It works without an API key, but Google may rate-limit anonymous requests. Add an optional Google API key in the Data Machine tool settings under PageSpeed for higher limits.
Data Machine Business registers the same PageSpeed surfaces that previously lived in Data Machine core:
- AI tool:
pagespeed - Ability:
datamachine/pagespeed - REST endpoint:
POST /wp-json/datamachine/v1/analytics/pagespeed - WP-CLI command:
wp datamachine analytics pagespeed <action>
Existing PageSpeed API-key config is adopted automatically because the integration continues to use the datamachine_pagespeed_config site option.
| Action | Description |
|---|---|
analyze |
Full Lighthouse audit with category scores and key metrics |
performance |
Focused performance score and Core Web Vitals metrics |
opportunities |
Optimization opportunities sorted by estimated savings |
wp datamachine analytics pagespeed analyze --page-url="https://example.com" --strategy=mobile
wp datamachine analytics pagespeed performance --page-url="https://example.com" --strategy=desktop
wp datamachine analytics pagespeed opportunities --page-url="https://example.com" --format=jsoncurl -X POST https://example.com/wp-json/datamachine/v1/analytics/pagespeed \
-H "Content-Type: application/json" \
-H "X-WP-Nonce: {nonce}" \
--cookie "{auth_cookie}" \
-d '{"action":"analyze","url":"https://example.com/","strategy":"desktop"}'Google Search Console uses a Google service account, not the shared Google OAuth user credential.
- Go to Google Cloud Console
- Create or select a project with the Search Console APIs enabled
- Create a service account and JSON key
- Add the service account email as a user on the Search Console property
- Configure the
google_search_consoletool in Data Machine settings with the JSON key and property URL
Existing Data Machine core installations keep using the same datamachine_gsc_config option, so activating Data Machine Business adopts previously saved Search Console configuration automatically.
- AI tool:
google_search_console - Ability:
datamachine/google-search-console - REST:
POST /wp-json/datamachine/v1/analytics/gsc - WP-CLI:
wp datamachine analytics gsc query_stats
Fetches data from Google Sheets with three processing modes:
- By Row: Process one row at a time (deduplication supported)
- By Column: Process one column at a time
- Full Spreadsheet: Process entire sheet at once
Appends structured data to Google Sheets with customizable column mapping.
Slack integration uses a Bot Token (xoxb-...) rather than OAuth2. The token is long-lived and managed in your Slack App settings.
- Go to Slack API: Applications
- Click Create New App → From scratch
- Give it a name (e.g., "Data Machine") and select your workspace
- Go to OAuth & Permissions in the sidebar
- Under Bot Token Scopes, add:
chat:write— Send messageschannels:history— Read messages from public channelsgroups:history— Read messages from private channelschannels:read— List public channels (optional)groups:read— List private channels (optional)
- Click Install to Workspace (or reinstall if already installed)
- Copy the Bot OAuth Token (
xoxb-...)
- Go to Data Machine → Settings in WordPress admin
- Find the Slack provider configuration
- Paste your Bot OAuth Token
- Click Validate to verify the connection
The bot must be explicitly added to any channel it should post to or read from:
- Open the channel in Slack
- Type
/invite @Data Machine(or whatever you named your app)
Posts messages to a configured Slack channel. Supports:
- Plain text and Slack mrkdwn formatting
- Source URL appending
- Thread replies (reply to a specific message)
- Link unfurling (rich previews)
Fetches messages from a configured Slack channel with:
- Configurable message limit (1-1000)
- Time-based filtering (oldest/latest timestamps)
- Per-message deduplication (skips already-processed messages)
- Automatic filtering of join/leave noise
datamachine/post-message-slack— Post a message to any channeldatamachine/fetch-messages-slack— Fetch messages from any channel
Discord integration uses a Bot Token from the Discord Developer Portal. The token is long-lived and managed in your application settings.
- Go to Discord Developer Portal
- Click New Application, give it a name (e.g., "Data Machine")
- Go to Bot in the sidebar
- Click Reset Token and copy the token (you only see it once)
- Under Privileged Gateway Intents, enable any intents your use case requires
- Go to OAuth2 → URL Generator in the sidebar
- Under Scopes, select
bot - Under Bot Permissions, select:
Send Messages— Post messages to channelsRead Message History— Fetch messages from channels
- Copy the generated URL and open it to invite the bot to your server
- Go to Data Machine → Settings in WordPress admin
- Find the Discord provider configuration
- Paste your Bot Token
- Click Validate to verify the connection
The bot can see channels based on its server permissions:
- Ensure the bot's role has Read Messages and Send Messages permissions in the target channel
- For private channels, explicitly grant access to the bot's role
Posts messages to a configured Discord channel. Supports:
- Plain text messages
- Source URL appending
- Discord embed objects for rich formatting
Fetches messages from a configured Discord channel with:
- Configurable message limit (1-100)
- Pagination via before/after message IDs
- Per-message deduplication (skips already-processed messages)
- Automatic filtering of join/leave and system messages
datamachine/post-message-discord— Post a message to any channeldatamachine/fetch-messages-discord— Fetch messages from any channel
The amazon_affiliate_link AI tool searches Amazon products and returns an affiliate URL, product title, thumbnail, and ASIN. It is available in Data Machine chat and pipeline contexts when Data Machine Business is active.
Existing credentials saved by older Data Machine core versions are adopted automatically because the extension uses the same datamachine_amazon_config site option.
- Join or open Amazon Associates.
- Create Amazon Creators API credentials.
- In Data Machine tool settings, configure Credential ID, Credential Secret, Partner Tag, and Marketplace.
- Use
amazon_affiliate_linkonly for genuinely relevant product references.
Bing Webmaster Tools is owned by Data Machine Business. When this plugin is active, it registers the same user-facing capability that previously lived in Data Machine core:
- Ability:
datamachine/bing-webmaster - AI tool:
bing_webmaster - REST route:
POST /wp-json/datamachine/v1/analytics/bing - WP-CLI:
wp datamachine analytics bing <action>
Existing sites keep their saved configuration because the business plugin adopts the original datamachine_bing_webmaster_config site option.
See Bing Webmaster Tools for setup and usage details.
GPL v2 or later
Chris Huber - chubes.net