Information about visitors (visitor_info)

The visitor_info object is used to set information about a visitor. It can be specified when initializing the settings of the app JS (InSendSettings) or passed on an event.


The visitor_info object contains a set of variables. The variables are divided into two types - Standard and Custom.


Custom fields are created in "My account"> _ "_Custom fields" and are used to submit custom data. The name of the custom field variable corresponds to the name of the key specified when the field was created.


An example of the structure of the visitor_info object with all known variables:

{ first_name: "John", // last_name: "Smith", // full_name: "John Smith", // email: "<a href="mailto:john_smith@example.com">john_smith@example.com</a>", // email phone: "8-800-000-000", // date_of_birth: "1974-07-30", // gender: "male", // "male" или "female" my_custom_numeric_property: 1234, // my_custom_string_property: "foo", // my_custom_date_property: "2014-04-20", // my_custom_boolean_property: "true" // }

If in your CMS the fields "name" and "last name" are not separated, then you have to enter the name in full_name instead of first_name and surname. InSend will separate first name and last name automatically


An example of a correct visitor_info entry when only the visitor's first name is known:

{ first_name: "John" }

An example of an incorrect record of visitor_info when only the first name of the visitor is known:

{ first_name: "John", last_name: "", email: "" }

Transferring an empty string as a value should only be used to clear irrelevant information from InSend.

An example of the transmission of visitor_info when you initialize a JS application:

window.InSendSettings = { visitor_info: { first_name: "John" }, app_key: "xxxxxxxxx" }

An example of the transmission of visitor_info when sending an event:

InSend('event', 'update_info', {}, {first_name: "John"});

An example of the transmission of visitor_info in the URL API:

The visitor_info object is used to set information about a visitor. It can be specified in the settings initialization of the JS app (InSendSettings) or passed over in the case of an event.

The visitor_info object contains a set of variables. Variables are divided into two types – standard and custom.

Custom properties are created in “My account”> “Properties” and are used to transfer custom data. The name of the custom properties variable corresponds to the name of the key specified when the field was created.

An example of the structure of the visitor_info object showing all the known variables:

{ first_name: "John", // last_name: "Smith", // full_name: "John Smith", // email: "<a href="mailto:john_smith@example.com">john_smith@example.com</a>", // email phone: "8-800-000-000", // date_of_birth: "1974-07-30", // gender: "male", // "male" или "female" my_custom_numeric_property: 1234, // my_custom_string_property: "foo", // my_custom_date_property: "2014-04-20", // my_custom_boolean_property: "true" // }

If in your CMS the fields “name” and “surname” are not separated, then instead of first_name and last_name you need to enter the name in full_name. InSend will divide the name and surname automatically.

An example of a correct record of visitor_info when only the first name of the visitor is known:

{ first_name: "John" }

An example of an incorrect record of visitor_info when only the first name of the visitor is known:

{ first_name: "John", last_name: "", email: "" }

Transferring an empty string as a value should only be used to clear irrelevant information from InSend.

An example of the transmission of visitor_info when you initialize a JS application:

window.InSendSettings = { visitor_info: { first_name: "John" }, app_key: "xxxxxxxxx" }

An example of the transmission of visitor_info when sending an event:

insend('event', 'update_info', {}, {first_name: "John"});

An example of the transmission of visitor_info in the URL API:

<a href="http://site.com/?InSend%5Bevent%5D=update_info&InSend%5Bvisitor_info%5D%5Bfirst_name%5D=John">http://site.com?InSend[event]=update_info&InSend[visitor_info][first_name]=John</a>
		
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.