Gross profit is how much you keep as profit from sales, after taking out discounts, refunds, and CoGS, before shipping and taxes . The benefit of using gross profit instead of eg, net revenue is the ability to focus more on the "bottom line", especially if there are significant differences in CoGS between your products.
A related metric is gross profit after advertising costs (GPAAC), which factors in the costs from acquiring a new (or nurturing an existing) customer.
Gross profit = Net revenue - CoGS
= (Gross revenue) - Refunds
= ((Total sales - Discounts) - Refunds) - CoGS
In Shopify, gross profit can be derived from subtotal_price, refunds, and cost per item.
: Sometimes, gross profit is calculated as after shipping and taxes. We currently don't factor in shipping and taxes but are looking into doing so in the future.