I am redirecting my customer to new site using window.open()
. I wanted to display some message or image before that site is loaded.
Here is my code.
<input class="btn add-to-cart-btn" onclick="two();"
type="button" value="More Info At {{ product.vendor }}"/>
JavaScript code :
<script>
function two()
{
window.open('{{ product.metafields.google.custom_label_0 }}'); trackOutboundLink('{{ product.metafields.google.custom_label_0 }}'); }
alert("please wait your page is loading ");
var trackOutboundLink = function(url) { ga('send', 'event', 'outgoing', 'click', url, { 'transport': 'beacon' });
}
</script>
Here {{ product.metafields.google.custom_label_0 }}
is a dynamic URL. The test alert message is displaying in same page.
any help ?