Send nudge events to your own analytics system

Please follow the below step if you wish to get nudge events shared back to your own analytics system.

Create a class that implements the protocol HanselEventsListener with the following method.

#import <Hansel/Hansel-umbrella.h>

- (void) fireHanselEventwithName: (NSString*) eventName andProperties: (NSDictionary*) properties
{

  //Fire this hansel event using your analytics vendor as explained in the above section (Handling existing app events)
 
  //e.g. [AppCleverTap recordEvent:eventName withProperties:properties];

  //In case your app is using multiple analytics vendors, then please fire the hansel events with only one vendor
}
func fireHanselEventwithName(_ eventName:String,andProperties properties:[AnyHashable:Any]?) {
	 
   //Fire this hansel event using your analytics vendor as explained in the above section (Handling existing app events)
 
 //e.g. AppCleverTap.recordEvent(eventName, properties: properties, cleverTap: cleverTap)

//In case your app is using multiple analytics vendors, then please fire the hansel events with only one vendor
}

Step 2 : Registering the listener with Product Experience SDK

#import <SmartechNudges/Hansel-umbrella.h>
  
//Register the listener with Hansel SDK by using this code.
[HanselTracker registerListener:listener];
//Register the listener with Hansel SDK by using this code.
HanselTracker.registerListener(listener);

Note

  1. Please ensure to select the checkbox 'Send nudges to Analytics Provider' from Step 2 of Nudge creation flow.
2859
  1. Below are properties that you can expect in 'hansel_nudge_event'
  • interaction_map_name
  • nudge_name
  • nudge_type
  • app_id
  • user_id (fallback to device id if not present)
  • nudge_rating : NULL | Rating | NPS (will be a number)
  • nudge_mcq : MCQ (will be a string)
  • nudge_inputtext: NULL | text
  • nudge_action: button1/2_clicked | buttontext | close_clicked | noaction_autodismissed | noaction_screenchanged | noaction_appclosed | backdrop_dismissed

Next

You can choose to go back