ClickFunnels Zapier Purchase Template

How to send ClickFunnels purchases into Zapier and then into Funnelytics

Create a Trigger in Zapier

Select the Webhooks by Zapier app as a trigger. Choose the Catch Raw Hook option as the trigger event.

 

Get the webhook URL from Zapier and add that to your funnel in ClickFunnels under Settings > Manage Funnel Webhooks.

 

Add the URL for the "purchase_created" event.

 

Be sure to test your funnel so Zapier can have some data to work with.

Zapier Action: Code

The first action in the zap needs to be this code action. This will format the webhook payload that was received into the format that Funnelytics is expecting.

 

Open the Customize Run Javascript Dropdown and apply the following settings

Input Data

Add a key of "body" and the value will be the raw body payload from the incoming webhook in step 1 of the zap.

Code

Insert this code block (no customization needed - Just copy+paste):

const parsed = JSON.parse(inputData.body);

return {

email: parsed.contact.email,

created_at: parsed.created_at,

items: JSON.stringify(parsed.products.map(product => {

return {

product_id: product.id.toString(),

product_name: product.name,

total: parseFloat(product.amount.fractional) / 100,

};

})),

};

This will output the data in a nice format that you can reference in the next action.

Zapier Action: Webhook

The last step in the zap will be another webhook action. This one is going to send the data to Funnelytics.

Be sure to choose "Custom Request" as the action event.

 

Follow the format of the code outlined in this article.

 

Method: Post
URL: https://track-v3.funnelytics.io/events/commerce
Data Pass-Through: False
Data: {

"email": "",

"datetime": "",

"items":

}

Unflatted: Yes
Basic Auth: leave blank

Headers: Content-Type and Authorization

In the data field, you can reference the output from the previous steps