Skip to main content

WooCommerce Setup: Purchases Promotion

Written by Aldin Rey
Updated today

Learn how to set up a WooCommerce Purchases promotion in ViralSweep and install the widget on your store.

Already set up your promotion? Skip to Step 10 for installation.


Requirements

Before you begin, make sure:

  • You’re using WooCommerce

  • All products and variants have unique SKUs


Step 1: Create a promotion

  1. In ViralSweep, create a new promotion

  2. Select Purchases → WooCommerce


Step 2: Connect your store

If your store is already connected, it will appear at the top. Otherwise, follow these steps:

Get your store URL

  • Go to: WordPress → Settings → General

  • Copy the Site Address (URL)

Generate API keys

  1. Go to: WooCommerce → Settings → Advanced → REST API

  2. Click Add Key

  3. Enter:

    • Description: ViralSweep

    • Permissions: Read/Write

  4. Click Generate API Key

  5. Copy the Consumer Key and Consumer Secret

Paste these into ViralSweep to connect your store.


Step 3: Choose qualifying products

Decide which products qualify for the promotion:

  • All products (default), or

  • Specific products only

If selecting specific products:

  1. Click Update Products

  2. Select Import Products and All Variants

  3. Choose qualifying items from the list

If a customer purchases a non-selected product, they won’t earn entries.


Step 4: Configure promotion details

  • Add a promotion title

  • Set start and end dates

  • Choose the number of winners

  • Set Raffle Tickets Enabled to No (for non-profits only)

  • Enter your Store URL


Step 5: Set entry rules

By default, customers earn 1 entry per $1 spent, but you can customize this.

You can also:

  • Change currency (top right)

  • Schedule bonus entry periods

If enabled, the widget will notify users when an order does not qualify.


Step 6: Add order bonuses (optional)

Reward customers with bonus entries for orders over a certain value.

This can help increase your average order value (AOV).


Step 7: Add post-purchase actions (optional)

Allow customers to earn additional entries by completing actions like:

  • Social follows

  • Sharing content

Configure these in the Social Actions section.


Step 8: Customize the widget

  • Upload images for the widget

  • Add your official rules

  • Adjust styling in the Design section

  • Enable email notifications (optional)

Click Done to save your promotion.


Step 9: Install the widget (Checkout page)

We offer free installation. If you’d prefer help, contact support and invite [email protected] with editor access.


To install manually:

  1. In ViralSweep, go to the Install tab

  2. Copy the code under Step 1: Install to Checkout


Step 10: Add code to the order confirmation page

  1. In WordPress, go to:
    Tools → Plugin File Editor

  2. Select WooCommerce from the dropdown

  3. Open:
    templates > checkout > thankyou.php

Paste the widget code below the:

“Thank you. Your order has been received”

💡 Placement may vary depending on your theme—adjust as needed.


Step 11: Add global widget script

  1. In ViralSweep, copy code under:
    Step 2: Install to Theme

  2. In WordPress, go to:
    Tools → Theme File Editor

  3. Open:
    Parts > Footer.html

  4. Paste the code at the top of the file and save


Step 12: (Optional) Add to customer account page

If your store supports user accounts:

  1. Copy code from:
    Step 3: Install to Account Page

  2. In WordPress, go to:
    Tools → Plugin File Editor

  3. Select WooCommerce

  4. Open:
    templates > myaccount > dashboard.php

Paste the code below the “Hello” message.


Step 13: Test your setup

  • Place a test order

  • Confirm the widget appears on the order confirmation page

  • Log into the customer account (if enabled) to verify entries display correctly


Legal disclaimer

ViralSweep allows purchase-based sweepstakes, but laws vary by region.

You are responsible for ensuring compliance, including:

  • Local laws and regulations

  • Providing a free alternative method of entry (if required)

For help with legal compliance in the U.S. or Canada, contact ViralSweep.


Need help?

If you have questions, click the chat icon in the bottom-right corner to contact support.

Did this answer your question?