Event Object
  • 23 Dec 2023
  • 6 Minutes to read

    Event Object


      Article Summary

      The Event object helps you create custom events and event parameters in different 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 should not include any special character, non-Latin character or any space. Otherwise, this event will be ignored. You can use underscores.
      ParameterData Type
      eventNameString

      Method Signature

      +(InsiderEvent *)tagEvent:(NSString *)eventName;

      Method Examples

      // You can create an event without parameters and call the build method
      [[Insider tagEvent:@"eventname"] build];
      
      
      // You can create an event, then add parameters and call the build method
      [[Insider tagEvent:@"eventname"].addParameterWithInt(@"key", 10) build];
      
      
      // You can create an object and add the parameters later
      InsiderEvent *insiderExampleEvent = [Insider tagEvent:@"eventname"];
      
      
      // Do not forget to call build method once you are done with parameters
      // Otherwise your event will be ignored
      [insiderExampleEvent build];
      // You can create an event without parameters and call the build method
      Insider.tagEvent("eventname")?.build()
      
      
      // You can create an event, then add parameters and call the build method
      Insider.tagEvent("eventname")?.addParameterWithInt()("key", 10)?.build()
      
      
      // You can create an object and add the parameters later
      var insiderexampleEvent = Insider.tagEvent("eventname")?.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.

      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

      -(void)build;

      Method Examples

      [insiderExampleEvent build];
      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

      -(InsiderEvent*(^)(NSString *, NSString *))addParameterWithString;

      Method Examples

      // You can create an event, then add parameters and call the build method
      [[Insider tagEvent:@"eventname"].addParameterWithString(@"key", @"value") build];
      
      
      // You can create an object and add the parameters later
      InsiderEvent *insiderExampleEvent = [Insider 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];
      // You can create an event then add parameters and call the build method
      Insider.tagEvent("eventname")?.addParameterWithString()("key", "value")?.build()
      
      
      // You can create an object and add the parameters later
      var insiderexampleEvent = Insider.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

      -(InsiderEvent*(^)(NSString *, int))addParameterWithInt;

      Method Examples

      // You can create an event then add parameters and call the build method
      [[Insider tagEvent:@"eventname"].addParameterWithInt(@"key", 10) build];
      
      
      // You can create an object and add the parameters later
      InsiderEvent *insiderExampleEvent = [Insider 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];
      // You can create an event then add parameters and call the build method
      Insider.tagEvent("eventname")?.addParameterWithInt()("key", 10)?.build()
      
      
      // You can create an object and add the parameters later
      var insiderexampleEvent = Insider.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

      -(InsiderEvent*(^)(NSString *, double))addParameterWithDouble;

      Method Examples

      // You can create an event then add parameters and call the build method
      [[Insider tagEvent:@"eventname"].addParameterWithDouble(@"key", 10.5) build];
      
      
      // You can create an object and add the parameters later
      InsiderEvent *insiderExampleEvent = [Insider 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];
      // You can create an event then add parameters and call the build method
      Insider.tagEvent("eventname")?.addParameterWithDouble()("key", 10.5)?.build()
      
      
      // You can create an object and add the parameters later
      var insiderexampleEvent = Insider.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

      -(InsiderEvent*(^)(NSString *, NSDate *))addParameterWithDate;

      Method Examples

      // You can create an event then add parameters and call the build method
      [[Insider tagEvent:@"eventname"].addParameterWithDate(@"key", [NSDate date]) build];
      
      
      // You can create an object and add the parameters later
      InsiderEvent *insiderExampleEvent = [Insider tagEvent:@"eventname"];
      insiderExampleEvent.addParameterWithDate(@"key", [NSDate date]);
      
      
      // Do not forget to call build method once you are done with parameters.
      // Otherwise your event will be ignored.
      [insiderExampleEvent build];
      // You can create an event then add parameters and call the build method
      Insider.tagEvent("eventname")?.addParameterWithDate()("key", Date())?.build()
      
      
      // You can create an object and add the parameters later
      var insiderexampleEvent = Insider.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 parameter

      This method allows you to set the array 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*(^)(NSString *, NSArray *))addParameterWithArray;

      Method Examples

      // You can create an event then add parameters and call the build method
        [[Insider tagEvent:@"eventname"].addParameterWithArray(@"key", [NSArray arrayWithObjects: @"value1", @"value2", @"value3", nil]) build];
      
      
      // You can create an object and add the parameters later
      InsiderEvent *insiderExampleEvent = [Insider tagEvent:@"eventname"];
      insiderExampleEvent.addParameterWithArray(@"key", [NSArray arrayWithObjects: @"value1", @"value2", @"value3", nil]);
      
      
      // Do not forget to call build method once you are done with parameters.
      // Otherwise your event will be ignored.
      [insiderExampleEvent build];
      let arr = ["value1", "value2", "value3"]
              
      // You can create an event then add parameters and call the build method
      Insider.tagEvent("eventname")?.addParameterWithArray()("key", arr)?.build()
      
      
      // You can create  an object and add the parameters later
      var insiderexampleEvent = Insider.tagEvent("eventname")
      insiderexampleEvent?.addParameterWithArray()("key", arr)
      
      
      // 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 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

      -(InsiderEvent*(^)(NSString *, bool))addParameterWithBoolean;

      Method Examples

      // You can create an event then add parameters and call the build method
      [[Insider tagEvent:@"eventname"].addParameterWithBoolean(@"key", true) build];
      
      
      // You can create an object and add the parameters later
      InsiderEvent *insiderExampleEvent = [Insider 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];
      // You can create an event then add parameters and call the build method
      Insider.tagEvent("eventname")?.addParameterWithBoolean()("key", true)?.build()
      
      
      // You can create  an object and add the parameters later
      var insiderexampleEvent = Insider.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.

      Was this article helpful?

      What's Next
      ESC

      Eddy, a super-smart generative AI, opening up ways to have tailored queries and responses