Using cart attributes and UTM parameters in URLs
You may want to collect additional information from customers or track conversions in the journey from the cart to the Thank You page.
This guide provides steps for appending parameters to your cart URL to collect or pass information.
Platform:
- Recharge Checkout on Shopify
Cart attributes and notes on the cart page
Note:
This guide requires custom code and is not supported by Recharge as per the design and integration policy. If you require further assistance, work with a third-party developer.
Cart attributes and notes increase the amount of information captured in the customer's cart. Following checkout, cart attributes and notes can be viewed in the Additional Details section within the Shopify order.
Add cart attributes using URL parameters on the cart page.
For example:
/cart?attributes[where-from]=came-from-newsletter-2013-02-14&attributes[some-other-key]=some-value
Add cart notes using URL parameters on the cart page.
For example:
/cart?note=came-from-newsletter-2013-02-14
Add cart attributes using input fields on the cart page:
<input type="hidden" name="attributes[some-key]" value="some-value" />
To use this feature, you will need version 3.2 or later of thesubscription-cart-footer.liquidsnippet in your Shopify theme files. If you have an earlier version, contact Recharge support to update this file to the latest version.
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 URLs of your marketing or promotional efforts. When your appended URL is visited, it allows analytics software to track information, such as how visitors are coming to your site and how they are interacting with any content associated with a campaign.
The cart page will add UTM parameters from the Shopify cookie to the cart attributes and the following Recharge record:
- Charge
- Customer
- Subscriptions
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 snippet in your Shopify theme files. Refer to Identifying the subscription-cart-footer.liquid file version to determine which version you have.
- Contact Recharge support to update the
subscription-cart-footer.liquid
file version if you are using an earlier version.
- Contact Recharge support to update the
- If you have version 3.0.0 or greater and would like to add the functionality without updating the entire subscription-cart-footer.liquid snippet, visit Adding UTM parameter functionality to existing subscription-cart-footer.liquid file.
Updated 6 months ago