I am attempting to embed a chat widget if utm_source=VALUE (any of these values)
Here is the surrounding code:
var ref1 = document.referrer;
IF STATEMENT HERE
{
alert("Welcome to Ellas Bubbles");
s1.src='https://embed.tawk.to/620675459bd1f31184dc28c0/1frkjk5mj';
}
You can test it here: https://ellasbubbles.com
I have tried the following, which is only working on 'ccov':
if ((ref1.indexOf('ccov') || ref1.indexOf('top10') || ref1.indexOf('cenf') || ref1.indexOf('aip') || (getcookie('track-page-1').indexOf('ccov')>-1) || (getcookie('track-page-1').indexOf('top10')>-1) || (getcookie('track-page-1').indexOf('cenf')>-1) || (getcookie('track-page-1').indexOf('aip')>-1)) > -1)
I have also tried this:
if ((ref1.indexOf('ccov' || 'top10' || 'cenf' || 'aip') || (getcookie('track-page-1').indexOf('ccov' || 'top10' || 'cenf' || 'aip')>-1)) > -1)
{
s1.src='https://embed.tawk.to/620675459bd1f31184dc28c0/1frkjk5mj';
}
Which is also only working on the first value, 'ccov'.
I have also tried this:
if ((ref1.indexOf('ccov', 'top10', 'cenf', 'aip') || (getcookie('track-page-1').indexOf('ccov', 'top10', 'cenf', 'aip')>-1)) > -1)
Which is also only working on the first value
Is there a better way to go about this?