What is Advanced Cash on Delivery?

Cash on Delivery (or COD) is a payment method which allows your domestic customers to pay for their items in cash when the items are delivered. This payment method is available worldwide, but can only be handled for customers within the same country as your store.

When using COD as a payment method there are often fees from the carrier that can occur. Since COD is a payment method, Shopify does not allow sellers to charge buyers for selecting it. With our app, sellers are able to pass those fees onto the customers by creating custom shipping methods that include the extra fee.

Sections in this Guide

  1. Getting started with COD
  2. Setting up custom shipping rates
  3. Setting up the Javascript for COD
  4. Grabbing Javascript from Google Analytics
  5. Enabling COD in your store
  6. Troubleshooting / FAQ

1. Getting Started with COD

Requirements: Shopify store admin account, Google Analytics account
To get started using the Advanced Cash on Delivery Global app make sure you have it installed from the Shopify app store, which can be found here. Once installed you can see it if you click "Apps" on the left hand sidebar.


Select "Advanced Cash on Delivery Global" to access the settings panel for the app.


The settings panel for the app will look like this. You can change a variety of things such as the subtotal range that is eligible for COD.


 
Note: When you change your country, make sure you click "Save" in order to be able to set your custom rates.

2. Setting up Custom Shipping Rates

To add custom shipping rates select "Require customer to use custom shipping rates" and then select "Add rate". 

A new menu will appear where you can add a custom rate.

 

3. Setting up the Javascript for COD

Next you need to set up the Javascript to enable the COD payment method. As mentioned earlier, we are essentially making custom shipping methods (that include the COD fee). Shopify does not know we are using this work around and thus will display non-COD shipping methods (default shipping methods that do not include the COD fee) to ALL customers even if they selected COD.

We are going to set up a Javascript work around that will hide those other non-COD methods to all customers who have chosen COD as a payment method.

From your Shopify admin page, click the bottom button on the left hand side that says "Settings".

From there, select the option "Payment providers".

Scroll down until you reach "Manual Payments" and select "Cash on Delivery (COD) from the drop down.

Once selected click "Activate" on the bottom right hand side to enable COD payment.

4. Grabbing Javascript from Google Analytics

Now head to Google Analytics and select "Admin", which is at the bottom of the right hand navigation bar.

In the middle column you will see a section with your shop name. Click the button  under it that called "Tracking info".

Note: If you have multiple websites under your Google Analytics account, make sure your Shopify shop name is displayed under the middle column. If it's not, click the arrow to the right to select your store.

If you have not added your Shopify store to your Google Analytics account, click "Add property" to add it.

Once you click that a menu will drop down and from there click "Tracking Code".


From this you will see your Tracking ID and below that will be some code under "Global Site Gatg ("gst"). Copy that and head back to your Shopify Admin page.

5. Enabling COD in Your Store

Once you have returned to your admin page, click the button "Online Store" in the right hand bar. Then click "Preferences" in the menu that appears below that.

From there, scroll down until you see the "Google Analytics" box. Paste that code you had just copied from Google Analytics and click "Save".

Once you click save wait a few seconds for the page to update (you can also manually refresh the page). You will see your Google Analytics ID where you had pasted that code. Click "Add custom Javascript" and paste this code.

Once you paste the code remember to replace "CODShippingName" with the name of your shipping method you created (Rate Name). 

Note: If you already have Javascript in your custom Javascript box, paste our code after your existing code.

6. Troubleshooting / FAQ

Q: What is the CODShippingName?

A: The CODShippingName is the name of your shipping method. This should be a phrase that is consistent amongst all your shipping methods.

You can name your shipping methods whatever you want, but you should stick to a certain format to avoid confusion. The javascript code checks if the currently selected shipping method contains whatever you put as the value for CODShippingName.

Example shipping method names:
Cash on Delivery, Goods up to 100$
Cash on Delivery, Goods up to 200$
Cash on Delivery, Goods up to 500$

Note: make sure all of your shipping rates contain the same phrase like in the example above.

Q: Why are other shipping methods hidden at checkout?

A: Because Shopify does not allow sellers to charge customers a fee during the payment step so we must add the extra fee onto the shipping.

The Javascript takes the CODShippingName and if the customer has chosen a payment method containing that name all other payment methods are hidden.