i have one submit button in my page , where i wanted to open that link in different window .
check this code
<input class="btn add-to-cart-btn" onclick="one();two();" type="submit" value="More Info At {{ product.vendor }}"/>
java script code
<script>
function one(){
trackOutboundLink('{{ product.metafields.google.custom_label_0 }}');
}
function two(){
window.open('{{ product.metafields.google.custom_label_0 }}');
}
var trackOutboundLink = function(url) {
ga('send', 'event', 'outgoing', 'click', url, {
'transport': 'beacon',
'hitCallback': function(){document.location = url;}
});
}
</script>
the "product.metafields.google.custom_label_0" is a static url .
if i click that submit page then that link is opening in new window as well as same window .
But i wanted to open in different window only . how to control this ?