Skip to main content

Suma BazaarVoice Integrator

Overview

The Suma BazaarVoice Integrator plugin syncs WordPress/BigCommerce products with BazaarVoice's ratings and reviews platform, enabling product review collection, display, and syndication.

Plugin Details

Plugin Name: Suma BazaarVoice Integrator
Version: 1.1.0
Developer: Rhino Group
Location: wp-content/plugins/suma-bazaarvoice-integrator/
Namespace: Suma\BazaarVoice\
Main File: init.php

Purpose

This plugin provides:

  • Product Feed Generation: Creates XML/CSV feeds for BazaarVoice
  • Review Display: Renders BazaarVoice reviews on product pages
  • Rating Aggregation: Shows star ratings in product listings
  • Q&A Integration: Displays customer questions and answers
  • SEO Benefits: Exposes review schema markup for search engines

Architecture

Directory Structure

suma-bazaarvoice-integrator/
├── init.php # Main plugin file
├── inc/ # Core classes
│ ├── class-plugin.php # Main plugin class
│ └── (other classes)
├── lib/ # Libraries and helpers
├── dist/ # Compiled assets
└── vendor/ # Composer dependencies

Main Plugin Class

File: inc/class-plugin.php

namespace Suma\BazaarVoice;

class Plugin {
public function activate() {
// Activation logic
}

public function deactivate() {
// Deactivation logic
}

public function run() {
// Initialize plugin
}
}

Features

1. Product Feed Export

Generates product catalog feeds for BazaarVoice in their required format.

Feed Fields:

  • Product ID (BigCommerce ID)
  • Product Name
  • Product Description
  • Image URL
  • Product Page URL
  • Category
  • Brand
  • UPC/EAN (if available)
  • Price (optional)

Feed Formats:

  • XML (preferred)
  • CSV (alternative)

Update Schedule:

  • Daily via WordPress cron
  • Manual generation available
  • Webhook trigger on product changes

2. Review Display

On-Page Reviews Widget

Embeds BazaarVoice reviews widget on product pages:

<div id="BVRRContainer" data-bv-show="reviews"></div>
<script>
$BV.ui('rr', 'show_reviews', {
productId: '12345'
});
</script>

Inline Ratings

Shows star rating summary in product cards:

<div data-bv-show="inline_rating" data-bv-product-id="12345"></div>

3. Questions & Answers

Displays customer Q&A section on product pages:

<div id="BVQAContainer" data-bv-show="questions"></div>
<script>
$BV.ui('qa', 'show_questions', {
productId: '12345'
});
</script>

4. SEO Schema Markup

Automatically injects structured data for reviews:

{
"@context": "https://schema.org",
"@type": "Product",
"name": "Walker's Razor Slim Electronic Muffs",
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.7",
"reviewCount": "342"
},
"review": [...]
}

Configuration

BazaarVoice Settings

Location: WordPress Admin → BazaarVoice Settings

Required configuration:

  • Client Name: BazaarVoice client identifier
  • Site ID: BazaarVoice site/environment ID
  • API Key: BazaarVoice API key
  • Staging/Production: Environment toggle

Product ID Mapping

Maps WordPress/BigCommerce products to BazaarVoice product IDs:

Default Mapping:

  • BazaarVoice Product ID = BigCommerce Product ID

Custom Mapping (if needed):

  • Custom field: bazaarvoice_product_id
  • Filter: suma_bv_product_id

Feed Configuration

Feed URL: /wp-json/bazaarvoice/v1/product-feed

Feed Settings:

  • Include Categories: Select categories to include
  • Exclude Products: Specify products to exclude
  • Update Frequency: Cron schedule (daily default)
  • Feed Format: XML or CSV

Integration with Theme

Elementor Widgets

Custom Elementor widgets for BazaarVoice:

BV Reviews Widget (bv-reviews-widget):

  • Full reviews display
  • Pagination support
  • Filter by rating
  • Sort options

BV Star Rating (bv-star-rating):

  • Inline star rating display
  • Review count
  • Configurable size and color

BV Questions Widget (bv-questions-widget):

  • Q&A display
  • Ask a question CTA
  • Answer voting

Shortcodes

Reviews Display:

[suma_bv_reviews product_id="12345"]

Star Rating:

[suma_bv_rating product_id="12345"]

Q&A Display:

[suma_bv_questions product_id="12345"]

JavaScript Integration

BazaarVoice Pixel

The plugin loads the BazaarVoice pixel script:

<script async src="https://display.ugc.bazaarvoice.com/static/{CLIENT_NAME}/{SITE_ID}/bvapi.js"></script>

Page Events

Product Page View:

$BV.configure('global', {
productId: '12345'
});

Transaction Tracking (post-purchase):

$BV.pixel.trackTransaction({
orderId: 'ORDER-123',
items: [
{
productId: '12345',
name: 'Product Name',
price: 49.99,
quantity: 1
}
]
});

REST API Endpoints

Product Feed Endpoint

URL: /wp-json/bazaarvoice/v1/product-feed
Method: GET
Auth: API key required (query parameter or header)

Response: XML or CSV product feed

Example:

curl "https://walkershearingprotection.com/wp-json/bazaarvoice/v1/product-feed?api_key=YOUR_KEY"

Review Stats Endpoint

URL: /wp-json/bazaarvoice/v1/review-stats/{product_id}
Method: GET

Response:

{
"product_id": "12345",
"average_rating": 4.7,
"review_count": 342,
"rating_distribution": {
"5": 245,
"4": 68,
"3": 19,
"2": 6,
"1": 4
}
}

Cron Jobs

Product Feed Update

Hook: suma_bv_update_feed
Schedule: Daily at 2:00 AM
Action: Regenerate product feed XML/CSV

Manual Trigger:

wp cron event run suma_bv_update_feed

Review Stats Sync

Hook: suma_bv_sync_stats
Schedule: Every 6 hours
Action: Fetch latest review stats from BazaarVoice API

Filters & Hooks

Filters

Modify product data before export:

add_filter('suma_bv_feed_product_data', function($data, $product) {
// Customize product data
$data['custom_field'] = 'custom_value';
return $data;
}, 10, 2);

Change product ID mapping:

add_filter('suma_bv_product_id', function($bv_id, $post_id) {
// Use custom SKU instead of BC ID
$product = new BigCommerce\Post_Types\Product\Product($post_id);
return $product->sku();
}, 10, 2);

Customize review display:

add_filter('suma_bv_review_config', function($config) {
$config['sort'] = 'rating'; // Default sort by rating
return $config;
});

Actions

After feed generation:

add_action('suma_bv_feed_generated', function($feed_path) {
// Upload feed to external service
});

After review stats sync:

add_action('suma_bv_stats_synced', function($product_id, $stats) {
// Update custom fields with stats
update_post_meta($product_id, '_avg_rating', $stats['average_rating']);
}, 10, 2);

Styling

Default BazaarVoice Styles

BazaarVoice provides base CSS that can be overridden:

/* Custom BV styling in theme */
#BVRRContainer {
font-family: 'Your Font', sans-serif;
}

.BVRRRating {
color: #ff6600; /* Custom star color */
}

.BVRRReviewText {
font-size: 14px;
line-height: 1.6;
}

Theme Overrides

Located in: themes/suma-elementor/dist/css/bazaarvoice-custom.css

Performance Considerations

Lazy Loading

Reviews widget lazy loads by default:

  • Widget container renders immediately
  • Content loads after page load via AJAX
  • Improves initial page load time

Caching

Feed Caching:

  • Generated feeds cached for 24 hours
  • Cache invalidated on product changes
  • Manual cache clear available

Review Stats Caching:

  • Stats stored in WordPress transients
  • 6-hour expiration
  • Reduces API calls to BazaarVoice

SEO Benefits

Review Schema

Structured data automatically added:

  • Product review aggregates
  • Individual review snippets
  • Star rating display in SERPs
  • Rich snippet eligibility

Content Generation

Reviews add unique, user-generated content to product pages:

  • Improves keyword targeting
  • Adds fresh content regularly
  • Increases time-on-page
  • Reduces bounce rate

Troubleshooting

Reviews Not Displaying

  1. Check BazaarVoice script loading: Inspect page source for bvapi.js
  2. Verify product ID mapping: Ensure BC product ID matches BV product ID
  3. Check BazaarVoice dashboard: Verify product exists in BV catalog
  4. Browser console errors: Look for JavaScript errors blocking widget

Feed Generation Failing

  1. Check API credentials: Verify client name, site ID, API key
  2. Test product query: Ensure products are being retrieved
  3. Check disk space: Verify server has space for feed files
  4. Cron status: Confirm WordPress cron is running

Review Stats Not Syncing

  1. Verify API key: Test API connection to BazaarVoice
  2. Check cron schedule: Ensure suma_bv_sync_stats is scheduled
  3. Review API logs: Check for rate limiting or API errors
  4. Manual sync: Trigger sync manually to test

Development & Testing

Sandbox Environment

BazaarVoice provides staging environments:

  • Staging: Test feed and review display
  • Production: Live reviews and ratings

Toggle in Settings: Switch between staging/production mode

Manual Feed Generation

# Generate product feed via WP-CLI
wp eval "do_action('suma_bv_update_feed');"

Debug Mode

Enable debug logging:

// wp-config.php
define('SUMA_BV_DEBUG', true);

Logs output to: wp-content/debug.log

Next Steps