Jan 28, 20205:58 PM - last edited on Mar 3, 20205:11 PM by lalexander
Unique/Dynamic Coupon Codes
I’m wondering if anyone here has done unique/dynamic coupon codes with HubSpot before?
For example, this is something we would like to do for a birthday campaign - to provide a discount on their next purchase with their unique coupon code, which is valid for say 30 days from when it was sent.
How this could be set up will vary depending on systems outside of HubSpot, but curious to see what anyone has done here.
This is very similar to a micro-influencer campaign we setup last year using dynamic discount codes that work in Shopify, which got triggered by Hubspot. Since the tools are easy to use, we completed this build in about 6 hours with two people. We've run it for a few months, and made over 1,000 variable discounts, so it's proven to be very reliable. Here's the outline of what we did.
Step 1: Hubspot - Setup a workflow to initiate a new discount code
Trigger: Can be your choice. ( We triggered based on a form fill, but you could easily use a date field )
Action: Send Webhook. I will come back to this in a couple steps.
Step 2: Hubspot - Add a discount code property to contact records
Single line text is the best option. This is where your birthday discount code will go. We called our property "Influencer Registered Discount Code".
Step 3: Hubspot - Create a workflow to alert the contact of their discount
Action: Send Email. Create a marketing email that will send the discount code. Use a personalization token ( Step 2 ) where you want to place the discount code.
Step 4: Shopify - Get an API key from your shopify account
Step 5: GCP - Build & deploy your new discount code script
Catch the webhook from Step 1
Create a price rule code in Shopify ( this is how the discount code works )
Create a dscount code in Shopify ( this is the actual code the customer gets )
Update the Hubspot contact with the discount code you made ( Update the property from Step 2 )
Enroll the contact in the workflow from Step 3
Hopefully this helps. If you decide to go the shopify route I can provide some example code if you need help on step 5. Good luck!