Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Try this</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready( function(){ var params = getUrlVars(); var utm_campaign = params["utm_campaign"]; var utm_content = params["utm_content"]; if( utm_campaign === "percentoff" &amp;&amp; utm_content == "COUPON_CODE_HERE") { alert("hi"); } if( utm_campaign === "freeship" &amp;&amp; utm_content === "COUPON_CODE_HERE") { alert("hello"); } }); function getUrlVars() { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&amp;'); for (var i = 0; i &lt; hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; } &lt;/script&gt; </code></pre> <p>As per you request these are function for cookie manipulation.</p> <pre><code>CreateCookie("cookie1", utm_campaign , 60); //Creates client side cookie, function CreateCookie(name, value, minutes) { var expires = ""; if (minutes) { var date = new Date(); date.setTime(date.getTime() + (minutes * 60 * 1000)); expires = "; expires=" + date.toGMTString(); } document.cookie = name + "=" + value + expires; } //Read cookie value function ReadCookie(name) { var key = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i &lt; ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(key) == 0) return c.substring(key.length, c.length); } return null; } //Remove cookie function RemoveCookie(name) { CreateCookie(name, "", -1); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload