Home / Archive / Add Visitor Type to the dataLayer
Duplicate Snippet

Embed Snippet on Your Site

Add Visitor Type to the dataLayer

This snippet enables you to pass a variable to the dataLayer to easily determine if the visitor is an existing customer or a new customer.

<10
Code Preview
js
window.dataLayer = window.dataLayer || [];
var email = '{email}';
dataLayer.push({
	'visitorType' : email.length > 0 ? 'existingCustomer' : 'newCustomer'
});

Comments

Add a Comment