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
In ViralSweep, create a new promotion
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
Go to: WooCommerce → Settings → Advanced → REST API
Click Add Key
Enter:
Description:
ViralSweepPermissions: Read/Write
Click Generate API Key
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:
Click Update Products
Select Import Products and All Variants
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:
In ViralSweep, go to the Install tab
Copy the code under Step 1: Install to Checkout
Step 10: Add code to the order confirmation page
In WordPress, go to:
Tools → Plugin File EditorSelect WooCommerce from the dropdown
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
In ViralSweep, copy code under:
Step 2: Install to ThemeIn WordPress, go to:
Tools → Theme File EditorOpen:
Parts > Footer.htmlPaste the code at the top of the file and save
Step 12: (Optional) Add to customer account page
If your store supports user accounts:
Copy code from:
Step 3: Install to Account PageIn WordPress, go to:
Tools → Plugin File EditorSelect WooCommerce
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.
