Variable number of tabs based on referring URL

New Member
4 0 0

I am trying to create a page that will have a variable number of tabs depending on the query string of the referring URL.

I've been able to get the referring URL by inserting this script:

<script language="javascript">
var ref=document.referrer;

How can I make it so that IF ref contains "this-text" then load 2 tabs?

Or, for that matter, to keep tabs out of the equation: IF ref contains "this-text" then <p>This works!!</p>

Any input will be greatly appreciated.

Thank you,


Shopify Partner
3131 195 576

use indexOf


Note: Liquid templates do not have user definable URL parameters so parameter parsing needs to be done on the frontend in javascript

Problem Solved? ✔️Accept and ? Like the solution so you can help others.
Buy me a coffee ☕ or donate to
Confused? Busy? Buy a custom solution

You want to create if/else and display 2 tabs with Liquid code?
This is not possible, you cannot create or declare a Liquid variable for JS.
Hope it helps!

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!