This article describes how to integrate a Printfection Giveaway campaign with Marketo by using Marketo's Webhook service and Printfection's API. This will allow you to store a Printfection Gift URL in Marketo as a custom field that can be utilized with your campaigns.
You don't need to be a developer or code-savvy to implement this workflow.
1. Create your new Printfection Giveaway campaign
From your account dashboard use the Start a New Campaign option to create a new Giveaway. Note: If you have an existing Giveaway campaign that you want to hook into simply skip to Step 3 of this article.
2. Customize your Giveaway items and branding
Next you'll want to add items that can be redeemed by your users. Do this via the Items navigation item up top.
You'll also want to update the Giveaway copy, branding, and payment method from the Settings page.
3. Create a new custom field in Marketo to hold your Giveaway links
At this point you'll want to create a place within Marketo to store these Giveaway links. You'll need to have proper account permissions to complete the following actions.
Go to Admin > Field Management > New Custom Field and choose the 'String' field type. Name the field something memorable such as 'Gift URL'.
4. Create a Marketo Webhook
Next you'll want to build a Marketo Webhook that can hit the Printfection API and return JSON of your Giveaway Gift URL.
To do this you'll need to know your campaign ID (located at the end of your campaign URL: printfection.com/account/campaign/overview.php?storeid=123456) and API Key (accessible from the top Account > API Access menu item in Printfection).
Now, inside Marketo to go Admin > Webhooks > New Webhook and provide the following field information:
- Webhook Name: Printfection Giveaway Sync
- Description: Syncs PF Gift URLs into Marketo
- URL: https://YOUR_API_KEY:@api.printfection.com/v2/orders
- Request Type: POST
- Template: {"campaign_id":123456}
- Request Token Encoding: JSON
- Response Type: JSON
5. Set your Webhook response mapping the Giveaway URL
Now that you have a Webhook that will hit the Printfection service and give you a response, you can map that response to the custom field you built in Step 3.
A Printfection JSON response contains a bunch of data, but in this case you want the Giveaway URL which lives under the 'url' response value . Edit your Webhook Response Mappings in the following manner:
- Response Attribute: url
- Marketo Field: GiftURL
6. Use your new Marketo Webhook with a campaign
You can now start using this Webhook inside Marketo as a Flow Step within any smart campaign.
In your Flow setup simply use the Call Webhook option and choose the Printfection Giveaway Sync webhook followed by whatever your next step is.
For example: sending an email with your {{lead.GiftURL}} variable linked to a 'Get Your Free T-Shirt' button.
Note: You might want to add a wait step in between the Call Webhook action and your Send Email action to make sure the API sends a response before the email gets sent.
Note: Webhooks can only be used in Marketo trigger campaigns and will not work in batch campaigns. If a webhook flow action is housed within a Marketo batch campaign you will receive a 1000 error response.
7. Your end-user can now receive a Giveaway gift link!
You're all set, test the process to make sure it works, and then use it with your real world marketing campaigns.