Here's a single sentence summary of the article: To fix the "Error: convert_attributes is empty or invalid after parsing" console error and enable proper purchase tracking in the Convert Manual Shopify Integration...
When using the Convert Manual Shopify Integration, you may encounter an error in the console that says "Error: convertattributes is empty or invalid after parsing" or a JSON-related error during the checkout process. This issue typically occurs when the experiment data is not properly written to the localStorage.convertattributes parameter. Additionally, purchase tracking will not work correctly when this error occurs.
Why does this happen?
This error often appears because the browser doesn't allow data to be written to localStorage when the user moves between different domains or subdomains. For example, if a customer starts on www.shop.com and then moves to checkout.shop.com for the checkout process, the browser treats these as separate domains and restricts data sharing.
How to fix it:
To resolve this issue, you need to adjust the domain settings in your Convert account to allow data sharing across all subdomains of your shop. Here's how to do it:
- Log in to your Convert account.
- Navigate to the Convert App.
- Select your project.
- Go to Configuration > Active Websites.
- Add a wildcard entry for your domain. For example, if your shop is on shop.com, add "*.shop.com" as an entry.
- Remove all other entries related to your domain (like www.shop.com, checkout.shop.com, etc.).
- Save your changes.
By adding the wildcard entry (*.shop.com), you're telling Convert to treat all subdomains of shop.com as part of the same site. This allows the experiment data to be shared across these subdomains, resolving the localStorage issue and enabling proper purchase tracking.
After making this change, test the checkout process again using a fresh incognito browser session. An incognito (or private) browsing session ensures you're starting with a clean slate, without any existing cookies or cached data that might interfere with the test. The error should no longer appear, and the Convert Manual Shopify Integration should work correctly across all pages of your shop, including proper purchase tracking.
If you continue to experience issues after making this change and testing in an incognito session, please contact Convert support for further assistance.