URL API

Allows you to call public JS API methods when you open a site page with a specific get parameter.

Get request structure:

insend[<method>]=<type> – name of the method with its type (required parameter) insend[properties][<name>]=<value> – object with event propertiesinsend[visitor_info][<field>]=<value> – visitor_info object with visitor data

The substituted variables correspond to the variables in the JS API:

insend('<method>', '<type>', <properties>, <visitor_info>);

Examples of custom event calls:

<a href="http://site.com/?insend%5Bevent%5D=custom&insend%5Bproperties%5D%5Bkey%5D=event_key&insend%5Bvisitor_info%5D%5Bemail%5D=mail@example.net">http://site.com?insend[event]=custom&insend[properties][key]=event_key&insend[visitor_info][email]=mail@example.net</a><br><a href="http://site.com?insend%5Bwidget%5D=show&insend%5Bproperties%5D%5Bid%5D=123<br>http://site.com?insend%5Btrack%5D=disable" rel="nofollow noopener noreferrer" target="_blank">http://site.com?insend[widget]=show&insend[properties][id]=123<br>http://site.com?insend[track]=disable

Analog of calling these methods via JS API:

insend('event', 'custom', {key: 'event_key'}, {email: 'example.net'});

insend('widget', 'show', {id: 123});

insend('track', 'disable');

There is an updated syntax for calling multiple methods through the API URL at the same time:

<a href="http://site.com/?insend%5Bwidget%5D%5B0%5D%5Baction%5D=show&insend%5Bwidget%5D%5B0%5D%5Bproperties%5D%5Bid%5D=1762&insend%5Bevent%5D%5B1%5D%5Baction%5D=update_info&insend%5Bevent%5D%5B1%5D%5Bvisitor_info%5D%5Bemail%5D=mail@example.net">http://site.com?insend[widget][0][action]=show&insend[widget][0][properties][id]=1762&insend[event][1][action]=update_info&insend[event][1][visitor_info][email]=mail@example.net</a>

Analog of calling these methods via JS API:

insend('widget', 'show', {id: 1762}); insend('event', 'update_info', {}, {email: '<a href="mailto:mail@example.net">mail@example.net</a>'});

Using the URL API allows you to transfer the values of the InSendSettings object:

<a href="http://site.com/?insend_settings%5Bdisable_auto_widgets%5D=true&insend_settings%5Bdebug_mode%5D=true">http://site.com?insend_settings[disable_auto_widgets]=true&insend_settings[debug_mode]=true</a>

Analog transfer of the values via JS:

InSendSettings.disable_auto_widgets = true;<br>InSendSettings.debug_mode = true;
		
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.