Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

Passing preview theme parameters in the URL instead of cookies

zach_h
Shopify Partner
2 0 0

Is there a setting that allows you to always pass preview theme ids as a url parameter instead of being saved as a cookie? 

In some circumstances, it would be easier with clients if the parameter was always in the URL.  

Replies 3 (3)

Liam
Shopify Staff
2626 282 719

Hi Zach - if you push the theme up to Shopify as an unpublished theme, you can generate a preview link in the format: https://123456789.shopifypreview.com/ - would sharing that URL with clients be easier?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

zach_h
Shopify Partner
2 0 0

This refers to the "share preview" option. However, it doesn't resolve the issue. When I'm on a product page and click "share preview," it only links to the homepage. Therefore, we always have to instruct the client to click the preview link and then share a second link to the specific page we want them to see.

I've discovered that appending "?preview_theme_id=123456789" to any page seems to work. However, I'm looking for a more streamlined method than manually altering the URL for this.

Liam
Shopify Staff
2626 282 719

Hi again Zach - I see what you mean here, and it is a common issue that devs are experiencing that we're looking into improving. For the moment the best option is to manually add the preview theme parameter to the URL. This is not ideal, but I've connected with the product team to pass on the feedback for a more streamlined approach. 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog