I would bet it has to do with the double “?” in the URL. When Klaviyo is adding the tracking parameters, it’s probably adding it after the first “?” and breaking it. Although, I don’t have a great fix at the moment.
@aliriveira Thanks for the suggestion - I tried replacing "/cart/add?" by "/cart/add%3F" - while the URL loads when trying it directly in the browser, I'm afraid it still fails when it comes through Klaviyo.
Hi @GustavoGovalo
Thanks for hopping in here @aliriveira to help your peer! You’re a rockstar!
Unfortunately, @GustavoGovalo as you mentioned, this won’t be possible unless you disable tracking. If that isn’t a possibility for you, do you mind stating your goal of adding these multiple parameters to see if we can find another workaround for you?
-Taylor
@Taylor Tarpley Hi, sure, happy to share some extra details. :)
I want to have a button/link in my Klaviyo email that takes the person clicking on it directly to a Shopify checkout with some loaded options - in this case, a subscription product, plus a discount code added.
The way I found of doing it is by loading the URL I mentioned initially, with some parameters added (the product's ID, quantity, selling plan, etc), so the checkout is loaded with everything I need. The URL works fine outside of an email, but when tracking is enabled, Klaviyo seems to replace all the parameters in the URL with the "_kx" parameter, thus breaking the URL and taking me to a 404 page.
Is there a way to keep tracking enabled, while still preventing Klaviyo from replacing those parameters by "_kx", perhaps on a specific URL or email template?
Hi @GustavoGovalo,
Thanks for that clarification!
While the only way to avoid this is to disable Email-to-website Tracking setting, you could choose to setup custom tracking if you really need to accomplish this. You’ll need to disable this setting and include the _KX parameter setting in their URL to create their on pseudo tracking.
However, with all custom coding, it will require time and energy to get this up and working! I would share this with your developer if you have one on your team or connect with a Klaviyo partner to set this up for you!
-Taylor
@Taylor Tarpley I see, thanks for the advice!
Do you have any directions on how the _KX parameter can be set up manually for an email? I understand that, with this, the Email-to-website Tracking can be disabled and the _KX parameter can be set up individually for each email template.
Best,
Gustavo
Hey @GustavoGovalo,
We do not offer any directions on how to setup the _KX parameter due to it’s custom nature. However, I would encourage you to utilize the resources found in our Developer Portal.
I would also keep in mind that disabling the Email-to-website Tracking setting mainly impacts:
- Tracking and triggering the clicked email event
- User identification (cookie) as they continue to navigate the site (active onsite, viewed product events, etc)
Since you intend to bring user back to a checkout page, in my experience, I don’t see these drawbacks impact too much since:
- Users are already opening the email and attribution can still be tied back to it
- Users would be cookied again after filling out the sign-up form.
David
@GustavoGovalo have you tried adding the products in another way?
If it's only 1 product:
https://your-store.myshopify.com/cart//VARIANT-ID]::QUANTITY]?payment==PAYMENT-METHOD]&discount==DISCOUNT-CODE]
In case of multiple products add a comma:
https://your-store.myshopify.com/cart/tVARIANT-ID]:]QUANTITY],]VARIANT-ID]:]QUANTITY]?payment=tPAYMENT-METHOD]&discount=tDISCOUNT-CODE]
I think this is another simpler way to accomplish the samen that hopefully doesn't break the url.
Omar Lovert // Polaris Growth // Klaviyo Master Platinum Partner
We help with e-commerce growth through CRO, Klaviyo and CVO
@Omar I'm afraid that https://gustavo-fine-guitars.myshopify.com/discount/GR13JsCWCTgQrOgiuV-TRXB_/?redirect=/cart/add?items%5B%5D%5Bid%5D=39879309459534%26items%5B%5D%5Bquantity%5D=1%26items%5B%5D%5Bselling_plan%5D=574554190%26return_to=/checkout was the only format I could find that supports adding what I need.
The way you suggested, unfortunately, the discount doesn't get applied, and I'm also unable to add the Selling Plan ID, which is necessary for the product to be added as a subscription.