import Router from 'next/router';
render() {
const brandclick = e => { //function name
e.preventDefault();
window.dataLayer.push({
event: 'mortgagecta', //event name
url: Router.asPath, //imported from router above
pageType: 'listingpage',
});
window.open('https://google.com', '_blank');
};
return (
<div className="brand" onClick={e => brandclick(e)}> //event function
<img src="/images/banner.jpg"
className="img-fluid"
alt="Brand cick"
/>
</div>
);
}