Event Object

Prev Next

The Event object helps you create custom events and event parameters in different data types. This article explains how you can build events and parameters in various data types.

Set tag event

This method returns a new chainable Insider event object in which you can add parameters. 

your title goes here
Your event name should be lowercase and not include special characters, non-Latin characters, or spaces. Otherwise, this event will be ignored. You can use underscores.
ParameterData Type
eventNameString

Method Signature

public InsiderEvent tagEvent(String eventName)

Method Example

// You can create an event without parameters and call the build method
Insider.Instance.tagEvent("eventname").build();


// You can create an event, then add parameters and call the build method
Insider.Instance.tagEvent("eventname").addParameterWithInt("key", 10).build();


// You can create an object and add the parameters later
InsiderEvent insiderExampleEvent = Insider.Instance.tagEvent("eventname");


// Do not forget to call build method once you are done with parameters
//Otherwise your event will be ignored
insiderExampleEvent.build();
your title goes here
If you do not call Insider's Build Event method at the end of the chaining, this method will not function.

Build event

This method allows you to build your Insider event object. 

your title goes here
You need to call this method to trigger your event.

Method Signature

public void build()

Method Example

insiderExampleEvent.build();

Set string parameter

This method allows you to set the string parameter of your Insider event object. 

your title goes here
Your parameter key should be lowercase and should not include any special character, non-Latin character or any space. Otherwise, this parameter will be ignored. You can use underscores.
ParameterData Type
keyString
valueString

Method Signature

public InsiderEvent addParameterWithString(String key, String value)

Method Example

// You can create an event then add parameters and call the build method
Insider.Instance.tagEvent("eventname").addParameterWithString("key", "value").build();


// You can create an object and add the parameters later
InsiderEvent insiderExampleEvent = Insider.Instance.tagEvent("eventname");
insiderExampleEvent.addParameterWithString("key", "value");


// Do not forget to call build method once you are done with parameters.
// Otherwise your event will be ignored.
insiderExampleEvent.build();

Set integer parameter

This method allows you to set the integer parameter of your Insider event object. 

your title goes here
Your parameter key should be lowercase and should not include any special character, non-Latin character or any space. Otherwise, this parameter will be ignored. You can use underscores.
ParameterData Type
keyString
valueInteger

Method Signature

public InsiderEvent addParameterWithInt(String key, int value)

Method Example

// You can create an event then add parameters and call the build method
Insider.Instance.tagEvent("eventname").addParameterWithInt("key", 10).build();


// You can create an object and add the parameters later
InsiderEvent insiderExampleEvent = Insider.Instance.tagEvent("eventname");
insiderExampleEvent.addParameterWithInt("key", 10);


// Do not forget to call build method once you are done with parameters.
// Otherwise your event will be ignored.
insiderExampleEvent.build();
your title goes here
If you do not call Insider's Build Event method at the end of the chaining, this method will not function.

Set double parameter

This method allows you to set the double parameter of your Insider event object. 

your title goes here
Your parameter key should be lowercase and should not include any special character, non-Latin character or any space. Otherwise, this parameter will be ignored. You can use underscores.
ParameterData Type
keyString
valueDouble

Method Signature

public InsiderEvent addParameterWithDouble(String key, double value)

Method Example

// You can create an event then add parameters and call the build method
Insider.Instance.tagEvent("eventname").addParameterWithDouble("key", 10.5).build();


// You can create an object and add the parameters later
InsiderEvent insiderExampleEvent = Insider.Instance.tagEvent("eventname");
insiderExampleEvent.addParameterWithDouble("key", 10.5);


// Do not forget to call build method once you are done with parameters.
// Otherwise your event will be ignored.
insiderExampleEvent.build();
your title goes here
If you do not call Insider's Build Event method at the end of the chaining, this method will not function.

Set date parameter

This method allows you to set the date parameter of your Insider event object. 

your title goes here
Your parameter key should be lowercase and should not include any special character, non-Latin character or any space. Otherwise, this parameter will be ignored. You can use underscores.
ParameterData Type
keyString
valueDate

Method Signature

public InsiderEvent addParameterWithDate(String key, Date value)

Method Example

Date date = new Date();


// You can create an event then add parameters and call the build method
Insider.Instance.tagEvent("eventname").addParameterWithDate("key", date);.build();


// You can create an object and add the parameters later
InsiderEvent insiderExampleEvent = Insider.Instance.tagEvent("eventname");
insiderExampleEvent.addParameterWithDate("key", date);


// Do not forget to call build method once you are done with parameters.
// Otherwise your event will be ignored.
insiderExampleEvent.build();
your title goes here
If you do not call Insider's Build Event method at the end of the chaining, this method will not function.

Set array of string parameter

This method allows you to set the array of string parameter of your Insider event object. 

your title goes here
Your parameter key should be lowercase and should not include any special character, non-Latin character or any space. Otherwise, this parameter will be ignored. You can use underscores.
your title goes here
You can call this method only with an array of string. Otherwise this parameter will be ignored.
ParameterData Type
keyString
valueArray (of string)

Method Signature

InsiderEvent addParameterWithStringArray(String key, String[] values)

Method Example

String[] stringArray = new String[]{"value1", "value2", "value3"};
Insider.Instance.tagEvent("eventName")
    .addParameterWithStringArray("key", stringArray)
    .build();
your title goes here
If you do not call Insider's Build Event method at the end of the chaining, this method will not function.

Set array of number parameter

This method allows you to set the array of number parameter of your Insider event object. 

your title goes here
Your parameter key should be only numbers. Otherwise, this parameter will be ignored.
your title goes here
You can call this method only with an array of string. Otherwise this parameter will be ignored.
ParameterData Type
keyNumber
valueArray (of number)

Method Signature

InsiderEvent addParameterWithNumericArray(String key, Number[] values)

Method Example

Number[] numberArray = new Number[]{5, 3.14, 100};

Insider.Instance.tagEvent("eventName")
    .addParameterWithNumericArray("key", numberArray)
    .build();
your title goes here
If you do not call Insider's Build Event method at the end of the chaining, this method will not function.

Set boolean parameter

This method allows you to set the boolean parameter of your Insider event object. 

your title goes here
Your parameter key should be lowercase and should not include any special character, non-Latin character or any space. Otherwise, this parameter will be ignored. You can use underscores.
ParameterData Type
keyString
valueBoolean

Method Signature

public InsiderEvent addParameterWithBoolean(String key, boolean value)

Method Example

// You can create an event then add parameters and call the build method
Insider.Instance.tagEvent("eventname").addParameterWithBoolean("key", true).build();


// You can create an object and add the parameters later
InsiderEvent insiderExampleEvent = Insider.Instance.tagEvent("eventname");
insiderExampleEvent.addParameterWithBoolean("key", true);


// Do not forget to call build method once you are done with parameters.
// Otherwise your event will be ignored.
insiderExampleEvent.build();
your title goes here
If you do not call Insider's Build Event method at the end of the chaining, this method will not function.

Set multiple parameter

This method allows you to set more than one parameter of your Insider event object at a time. 

ParameterData Type
parameters

Map<String, ?>

Method Signature

public InsiderEvent addParameters(Map<String, ?> parameters)

Method Example

String[] array = new String[3];

array[0] = "item1";
array[1] = "item2";
array[2] = "item3";

Map<String, Object> parameters = new HashMap<>();

parameters.put("tag_array", array);
parameters.put("tag_bool", true);
parameters.put("tag_double", 22.2);
parameters.put("tag_string", "insider");
parameters.put("tag_date", new Date());
parameters.put("tag_int", 122);

Insider.Instance.tagEvent("test_event").addParameters(parameters).build();