Klaviyo x Submarine

1. Summary

Submarine integrates with Shopify Flow, allowing merchants to connect Submarine with their existing systems and use Flow to create customised workflows without any extra hassle. As a Klaviyo partner and many of our existing merchants using Klaviyo for customer email templates, we have made it as easy as we can for getting new notifications setup and sending from Klaviyo.

1.1 Available flows for Submarine Platform

Submarine has a selection of available flows that merchants can leverage to either communicate with customers or create operation workflows.
You can find a detailed list of all flows available here.

2. Getting started

2.1 Setting up Klaviyo with Shopify

The follow steps are a guide on installing Klaviyo to your Shopify store and connecting Klaviyo and Shopify so you can leverage Klaviyo flow actions.
  1. Install the Klaviyo app here and follow the prompts to set up your account
  1. Once your account has been set up, select the account name in the lower left. Then, click integrations
  1. Search for Shopify, then click Add Integration
  1. Paste the store URL in the box, ensuring its in the format mystore.myshopify.com.
  1. After configuring your settings, click Connect to Shopify. This will take you to your Shopify account. You may be prompted to log in to Shopify.
  1. Review the permissions and click Install app. This begins syncing your Shopify data with Klaviyo and takes you back into your Klaviyo account.
Image without caption

2.2 Setting up Flow on Shopify

  1. Install the Shopify Flow app, found here
  1. You’ll be redirected to this page, and click ‘install’, top right.
Image without caption

3. Setting up a flow to Track an event in Klaviyo

There are two options for setting up your flows - manually on a per workflow basis or importing from our files below.

3.1 Option 1: Setup a flow manually

Step 1. Once you’ve installed the Shopify Flow and the Klaviyo app on your store. Open Flow and locate the ‘Create Workflow’ button in the top right.
Image without caption
Step 2. Click on Submarine and you will see the range of Flow triggers we have available for you to use. As an example. lets setup ‘Campaign Upcoming Charge’ together
Select Submarine > Campaign upcoming charge as the trigger.
Image without caption
Step 3. After you select the trigger you will be asked to select between Condition or Action, if you have no Conditions for sending the trigger then click Action.
Then select the Klaviyo app on the right hand side tab, select ‘Track an event’
Image without caption
Step 4. The following form will show and you will need to add inputs for each entry so that when the trigger fire it sends that data over to Klaviyo.
🎵
Please note: Flows must always be written in camelCase.
Image without caption
You can populate your form with the follow;
Klaviyo Public API Key: Found in Account > Settings > API keys
Event name: Whichever event you are wanting to track. Different events can be found here For this example will be doing Upcoming preorder charge
Customer Email Address: {{customer.email}}
Customer First Name: {{customer.firstName}}
Customer Last Name: {{customer.lastName}}
Customer Properties: {{customer.createdAt}}
Event Properties:
json
{ "campaignType": {{campaignType}} "campaignName": {{campaignNames}} "campaignDescriptions": {{campaignDescriptions}} "amount": {{amount}} "campaignType": {{amountCurrency}} "amountDescription": {{amountDescription}} "dueAt" : {{dueAt}} "orderName" : {{order.name}} }
Step 5. Name your workflow something easy to recognize and click Save.
Step 6. Some workflows are simple to test and others are a bit more difficult, we have a section on firing the flow triggers below.

3.2 Option 2: Import Submarine workflows

A quicker way to get started would be to import the files below we have created,
To import these you will need to;
Step 1. Open Shopify
Step 2: Ensure you have both the Flow and Klaviyo app installed on the store
Step 3: Open Shopify Flow app
Step 4: Select a downloadable file from our list below.
Step 5: Click Import from the top right
Image without caption
Step 6: Select the files you downloaded in step 4.
Step 7: Once imported you will need to edit each workflow Track even Action to have your Klaviyo accounts Public key.
  • To find this, in Klaviyo navigate to "Account > Settings > API Keys"
Image without caption
  • Replace the Public API key with yours and click Apply changes.
Step 8: Test your new workflows using the guide linked below.

Subscription Flo

Submarine _ Shopify_ Payment failed .flow.cpgz
1.0KB
Submarine_ Upcoming subscription order .flow.cpgz
1.0KB
Submarine_ Subscription updated .flow.cpgz
1.0KB
Submarine_ Subscription created.flow.cpgz
1.0KB
Submarine_ Subscription order updated.flow.cpgz
1.1KB

Presale Campaign Flows

4. Testing your Presale flow triggers

4.1 Charge failed

  • Testing this flow trigger will require you to first place a test order with a card that will succeed at checkout and then change the payment method to one that will fail. This is because Shopify will reject a failing card at checkout, but not if we attach it later. Start your testing by placing an order with a card that will verify correctly during checkout.
  • Once there is a Campaign order, navigate to the Customer account and open the Payment methods modal.
  • Select the card you just used, click Replace card, and enter the details below.
    • Failing TEST MODE card:
      Card number: 4000000000000341
      Expiry: 12/26
      CSV: 123
  • Once that is done you can attempt capturing the next upcoming Subscription order.
  • For testing on a production store you will need to test with a live card that you can freeze or remove available funds from easily. Manually end or wait till the campaign or payment is due to charge and once it’s failed to charge the flow will run and the event will be tracked in Klaviyo.

4.2 Charge succeeded

  • Testing this flow trigger will require you place a test campaign with a card that will succeed, wait till the campaign or payment is due to charge and once it’s successfully charge the flow will run and the event will be tracked in Klaviyo.

4.3 Refund succeeded

  • Testing this flow will require a Campaign order with a successful deposit charge made on it, your settings in Submarine will need to have the Refund deposits checkbox set to true (checked) and you will need to cancel the campaign order from Submarine before the full payment is taken. Once this is done the flow will run and the event will be tracked in Klaviyo.

4.4 Campaign order created

  • Testing this flow trigger requires you create a campaign and place an order against it. Once you place an order against the campaign this flow trigger will fire.

4.5 Campaign upcoming charge

  • Testing the flow trigger requires a few days, or an adjustment to your stores configuration which can be done by the Submarine team. The default configuration for all stores is 2 days prior to a Submarine related charge but it can be reduced for testing purposes if requested.

4.6 Campaign order fulfilled

  • Testing this flow trigger requires you create a campaign and place an order against it. Once you place an order against the campaign you will need to end the campaign, allocate the inventory and this will trigger the workflow. More details on how to do the above steps are available here.

4.7 Campaign order cancelled

  • Testing this flow trigger requires you create a campaign and place an order against it. Once you place an order against the campaign, go to Submarine and cancel the campaign order, this will flow trigger will fire.

4.8 Presale & Crowdfunding campaign launched, ended and completed

  • To test this workflow you’ll need to move a campaign through each status. For each status change you’ll trigger a workflow.

5. Testing your Subscription flow triggers

4.1 Subscription Billing Attempt Failure

  • Testing this flow trigger will require you first place a test order with a card that will succeed at checkout and then change the payment method to one that will fail. This is because Shopify will reject a failing card at checkout, but not if we attach it later. Start your testing by placing an order with a card that will verify correctly during checkout.
  • Once there is a Subscription created from that order, go to the Customers account and open the Payment methods modal (right-hand sidebar).
  • Select the card you just used, click Replace card, and enter the details below.
    • Failing TEST MODE card:
      Card number: 4000000000000341
      Expiry: 12/26
      CSV: 123
  • Once that is done you can attempt capturing the next upcoming Subscription order.
  • Navigate to Submarine Subscription> Click the next upcoming order, More Actions, Process order.
  • This will result in the Subscription order failing to generate and will trigger the billing failed Flow.
  • For testing on a production store you will need to test with a live card that you can freeze or remove available funds from easily. Manually end or wait till the campaign or payment is due to charge and once it’s failed to charge the flow will run and the event will be tracked in Klaviyo.