As a merchant, you may want to collect additional information from a customer or track conversions from cart all the way to the Thank You page. This guide highlights how to append parameters to your cart URL to collect or pass information.
Before you start
This is an advanced customization and outside the scope of ReCharge support. Knowledge of web design languages such as HTML, CSS, JavaScript, and Liquid is required. If you require assistance, visit the Experts page.
Cart attributes and notes on the cart page
Cart attributes and notes allow the capturing of more information on the cart page. Following checkout, they can be viewed in the Additional Details section within the order in Shopify.
Add a cart attribute (or several) using a URL parameter(s) on the cart page. For example:
/cart?attributes[where-from]=came-from-newsletter-2013-02-14&attributes[some-other-key]=some-value
Add a cart note using a URL parameter on the cart page. For example:
/cart?note=came-from-newsletter-2013-02-14
Add a cart attribute (or several) using input fields on the cart page:
<input type="hidden" name="attributes[some-key]" value="some-value" />
Cart attributes on the checkout page
Access cart attributes and cart notes on all pages of the checkout using the cart_json object:
- Page 1 - Shipping information page
- Page 2 - Billing information page
- Page 3 - Thank you page
UTM Parameters
UTM parameters are tags you can add to the end of the URLs of your marketing or promotional efforts. When your appended URL is then visited, it allows analytics software to track information, such as how visitors are coming to your site and if they're interacting with any content associated with a campaign.
The cart page will add UTM parameters from Shopify cookie to the cart attributes and the following ReCharge record:
- Charge
- Customer
- Subscription
Version requirements
- To use this feature, you will need version 3.2 (updated on 2019/12/13) or later of the subscription-cart-footer.liquid file.
- If you have an earlier version, please contact the ReCharge Support team to update this file to the latest version.
- If you have version 3.0.0 or greater and would like to add the functionality without updating the entire subscription-cart-footer.liquid file, visit Adding UTM parameter functionality to existing subscription-cart-footer.liquid file.