In this article, you'll learn how you can track where your own sales come from with the IPN and follow those data records in Google Sheets.
To enable tracking for your own sales, add the next code line to the checkout page URL of the product you'd like to track, and press Enter:
It should look something like this:
Here ?metadata= is a parameter, and your_tracking_key is the value that displays the source of customer traffic.
Important! Do not change the ?metadata= parameter. There should be no spaces between the question mark, the metadata word, and the value.
You can change your_tracking_key value and use whatever tracking key you want.
It can be facebook for sales generated by Facebook, mail for sales generated via email, mylanding for sales generated at your landing page, and so on:
Now, switch to Google Sheets to configure the integration between CopeCart and Google Sheets.
Create a spreadsheet where you’d like all the required information to be transferred and name it accordingly. Then, add headers to columns—these would be the parameters you're looking for.
For example, let’s create a spreadsheet named “Tracking sheet” and assume that we need to track the next parameters:
The site that forwards traffic to your checkout page (this parameter will show where your sales are coming from).
The product name and its ID.
Some customer data like the customer's name and email address.
The amount paid by the customer for their order.
The payment status.
The date when the customer made the order.
Next, tell Zapier what exact thing it should react to and in what exact way.
To make Zapier know it should "listen" to your product sales process, you need to create a Webhook. In other words, you need to establish a mechanism of notifying the system that something had happened.
To do that, go to your Zapier account and follow the next steps:
Go to the Zaps menu.
Click on the Make a New Zap button.
Scroll down to Built-In Apps and select Webhooks by Zapier.
Choose Catch Hook as a trigger event and press Continue.
What you just did is created a Webhook Endpoint. It is a unique address where the specific messages will be sent to when some action happens.
Next, you need to configure an IPN connection between Zapier and CopeCart so that whenever the product is purchased, CopeCart sends a notification to the Webhook Endpoint.
To do that, open your CopeCart home page in a new tab, click on your username in the upper-right corner, and proceed to the IPN connections menu:
Create and name a new Generic IPN integration:
Now you need to tell CopeCart to send notifications to the Webhook Endpoint you created at Zapier. To do that, copy the Webhook URL from Zapier to the Notification URL field at CopeCart, enter a key (the same for both CopeCart and Zapier), select the Contract fulfillment integration option, and click on Save changes:
Go to the Product edit page and enable an IPN integration with Zapier:
Then, go to the product Checkout page, add the next line to the page URL, and press Enter:
Next, proceed to the Test order—fill in the fields with whatever customer information you want, select a payment plan and a Test payment option, and click on Order now:
You have just completed a test order.
Now, switch to Zapier and proceed to the next step by clicking on the Continue button. You will be redirected to the test step. We strongly recommend you proceed to the test by clicking on Test & Continue.
If the integration between CopeCart and Zapier works, you will be redirected to the next step:
Next, you should configure the interface between Zapier and Google Sheets:
Select the Google Sheets App.
Choose the Create Spreadsheet Row as an action event and press Continue. Whenever a customer purchases your product, a new row appears in a specific Google Sheet with the corresponding parameters.
Select the Google account (your personal or business account) where you already have created a spreadsheet as a very first step, and press Continue.
Next, you need to configure what information you'd like to be displayed at Google Sheets. Select Google Drive, Spreadsheet, and Worksheet, and proceed to configure the parameters.
Remember, you have already set the column headers, so now you should select what data from the IPN message corresponds to what column:
When you click on the Continue button, you will be redirected to another test step. Proceed to test to see if everything works right:
Switch back to your Google Sheets to check the result (click on the image to see it full size):
If configurations are correct, there will be no errors, and you can turn your Zap on!
After you have enabled the Zap, whenever the product is purchased, a corresponding record appears in your spreadsheet (click on the image to see it full size):
If you'd like to integrate CopeCart and Google Sheets via Zapier for other products, enable the corresponding Zapier connection for every product at a Product Edit page.