Table of contents Report a Tagged Event in an iOS App (reportTag) The reportTag API sends a tagged event from a mobile app to Aternity when monitoring custom activities. A custom activity for mobile apps starts and ends when the app reports specific events which match the events of an activity's signature file. If Aternity already reports these events by default, you do not need to add manual API calls. However, for some custom activities, you must manually tag and report those events using API calls. reportTag sends the AternityContext object, which you created when you tagged an event. Tagging a custom event with the API Before reporting, you can optionally add further data to the Context object, like a search term, or a file size, or anything else which you want to send to the activity's signature waiting on the server side. Before You Begin The system requirements of the developer's computer must conform to those of the Aternity iOS Mobile SDK. The Aternity iOS Mobile SDK requires a mobile device with at least iOS 8 (iPhone 4 or earlier cannot run iOS 8). Integrate the Aternity iOS Mobile SDK into your app development environment. Include the Aternity.h header file (in Objective-C) into your source code file. To add it to a Swift project, use a bridging header (see Apple's documentation). Initialize the SDK either automatically (by adding Aternity.plist to your project) or manually using activateWithDictionary. Method Definition reportTag sends the AternityContext object, which you created when you tagged an event. It is defined as a method belonging to the AternityContext object: @interface AternityContext : NSObject - (void)setContextValue:(NSString *)value forKey:(NSString *)aKey; - (NSString *)valueContextForKey:(NSString *)aKey; - (void)removeContextForKey:(NSString *)aKey; - (void)reportTag; @end Example Before reporting, you can optionally add further data to the Context object, like a search term, or a file size, or anything else which you want to send to the activity's signature waiting on the server side. In Objective-C: //Create an AternityContext object called "dl_start" which tags the start of "Download" AternityContext *dl_start= [[Aternity sharedManager] tagApplicationWithName:@"Download" withPhase:AternityStartPhase]; //You can also set some values in the context object before reporting it to the server [dl_start setContextValue:self.urlText.text forKey:@"FileName"]; [dl_start setContextValue:[fileAtrrib objectForKey:@"NSFileSize"] forKey:@"FileSize"]; //Report the AternityContext object with its tag and contextuals to the server [dl_start reportTag]; //When user taps Cancel, tell the server that the activity is canceled. //Optionally add contextuals here too. AternityContext *dl_cancel= [[Aternity sharedManager] tagCancelledWithName:@"Download"]; [dl_cancel reportTag]; //Tag and report an error to the server. AternityContext *dl_error = [[AternityAgent sharedManager] tagErrorWithName:@"Download"]; [dl_error reportTag]; In Swift: //Create an AternityContext object called "dl_end" which tags the end of "Download" var dl_end: AternityContext = Aternity.sharedManager().tagApplicationWithName("Download", withPhase:AternityEndPhase) //You can also set some values in the context object before reporting it to the server dl_end.setContextValue(self.urlText.text forKey:"FileName") dl_end.setContextValue(fileAtrrib.objectForKey("NSFileSize") forKey:"FileSize") //Report the AternityContext object with its tag and contextuals to the server dl_end.reportTag() //When user taps Cancel, tell the server that the activity is canceled. //Optionally add contextuals here too. var dl_cancel: AternityContext = AternityAgent.sharedManager().tagCancelledWithName("Download") dl_cancel.reportTag() //Tag and report an error to the server. var dl_error: AternityContext = AternityAgent.sharedManager().tagErrorWithName("Download") dl_error.reportTag() Parent topic Start Using the Aternity iOS SDK to Embed Monitoring in your iOS AppRelated tasksIntegrate the Aternity iOS SDK into your App(Add Breadcrumbs to Troubleshoot Mobile App Crashes (leaveBreadcrumb())Related referenceInitialize the Aternity iOS Mobile SDK Manually (activateWithDictionary)Set the Username with the Aternity iOS Mobile SDK (userNameStr)Set the Location's Site Name with the Aternity iOS Mobile SDK (setSite and setOffSite)Tag an Event in an iOS App (tagApplicationWithName)Set Contextual Data to Report from an iOS App (setContextValue) SavePDF Selected topic Selected topic and subtopics All content Related Links
Report a Tagged Event in an iOS App (reportTag) The reportTag API sends a tagged event from a mobile app to Aternity when monitoring custom activities. A custom activity for mobile apps starts and ends when the app reports specific events which match the events of an activity's signature file. If Aternity already reports these events by default, you do not need to add manual API calls. However, for some custom activities, you must manually tag and report those events using API calls. reportTag sends the AternityContext object, which you created when you tagged an event. Tagging a custom event with the API Before reporting, you can optionally add further data to the Context object, like a search term, or a file size, or anything else which you want to send to the activity's signature waiting on the server side. Before You Begin The system requirements of the developer's computer must conform to those of the Aternity iOS Mobile SDK. The Aternity iOS Mobile SDK requires a mobile device with at least iOS 8 (iPhone 4 or earlier cannot run iOS 8). Integrate the Aternity iOS Mobile SDK into your app development environment. Include the Aternity.h header file (in Objective-C) into your source code file. To add it to a Swift project, use a bridging header (see Apple's documentation). Initialize the SDK either automatically (by adding Aternity.plist to your project) or manually using activateWithDictionary. Method Definition reportTag sends the AternityContext object, which you created when you tagged an event. It is defined as a method belonging to the AternityContext object: @interface AternityContext : NSObject - (void)setContextValue:(NSString *)value forKey:(NSString *)aKey; - (NSString *)valueContextForKey:(NSString *)aKey; - (void)removeContextForKey:(NSString *)aKey; - (void)reportTag; @end Example Before reporting, you can optionally add further data to the Context object, like a search term, or a file size, or anything else which you want to send to the activity's signature waiting on the server side. In Objective-C: //Create an AternityContext object called "dl_start" which tags the start of "Download" AternityContext *dl_start= [[Aternity sharedManager] tagApplicationWithName:@"Download" withPhase:AternityStartPhase]; //You can also set some values in the context object before reporting it to the server [dl_start setContextValue:self.urlText.text forKey:@"FileName"]; [dl_start setContextValue:[fileAtrrib objectForKey:@"NSFileSize"] forKey:@"FileSize"]; //Report the AternityContext object with its tag and contextuals to the server [dl_start reportTag]; //When user taps Cancel, tell the server that the activity is canceled. //Optionally add contextuals here too. AternityContext *dl_cancel= [[Aternity sharedManager] tagCancelledWithName:@"Download"]; [dl_cancel reportTag]; //Tag and report an error to the server. AternityContext *dl_error = [[AternityAgent sharedManager] tagErrorWithName:@"Download"]; [dl_error reportTag]; In Swift: //Create an AternityContext object called "dl_end" which tags the end of "Download" var dl_end: AternityContext = Aternity.sharedManager().tagApplicationWithName("Download", withPhase:AternityEndPhase) //You can also set some values in the context object before reporting it to the server dl_end.setContextValue(self.urlText.text forKey:"FileName") dl_end.setContextValue(fileAtrrib.objectForKey("NSFileSize") forKey:"FileSize") //Report the AternityContext object with its tag and contextuals to the server dl_end.reportTag() //When user taps Cancel, tell the server that the activity is canceled. //Optionally add contextuals here too. var dl_cancel: AternityContext = AternityAgent.sharedManager().tagCancelledWithName("Download") dl_cancel.reportTag() //Tag and report an error to the server. var dl_error: AternityContext = AternityAgent.sharedManager().tagErrorWithName("Download") dl_error.reportTag() Parent topic Start Using the Aternity iOS SDK to Embed Monitoring in your iOS AppRelated tasksIntegrate the Aternity iOS SDK into your App(Add Breadcrumbs to Troubleshoot Mobile App Crashes (leaveBreadcrumb())Related referenceInitialize the Aternity iOS Mobile SDK Manually (activateWithDictionary)Set the Username with the Aternity iOS Mobile SDK (userNameStr)Set the Location's Site Name with the Aternity iOS Mobile SDK (setSite and setOffSite)Tag an Event in an iOS App (tagApplicationWithName)Set Contextual Data to Report from an iOS App (setContextValue)
Report a Tagged Event in an iOS App (reportTag) The reportTag API sends a tagged event from a mobile app to Aternity when monitoring custom activities. A custom activity for mobile apps starts and ends when the app reports specific events which match the events of an activity's signature file. If Aternity already reports these events by default, you do not need to add manual API calls. However, for some custom activities, you must manually tag and report those events using API calls. reportTag sends the AternityContext object, which you created when you tagged an event. Tagging a custom event with the API Before reporting, you can optionally add further data to the Context object, like a search term, or a file size, or anything else which you want to send to the activity's signature waiting on the server side. Before You Begin The system requirements of the developer's computer must conform to those of the Aternity iOS Mobile SDK. The Aternity iOS Mobile SDK requires a mobile device with at least iOS 8 (iPhone 4 or earlier cannot run iOS 8). Integrate the Aternity iOS Mobile SDK into your app development environment. Include the Aternity.h header file (in Objective-C) into your source code file. To add it to a Swift project, use a bridging header (see Apple's documentation). Initialize the SDK either automatically (by adding Aternity.plist to your project) or manually using activateWithDictionary. Method Definition reportTag sends the AternityContext object, which you created when you tagged an event. It is defined as a method belonging to the AternityContext object: @interface AternityContext : NSObject - (void)setContextValue:(NSString *)value forKey:(NSString *)aKey; - (NSString *)valueContextForKey:(NSString *)aKey; - (void)removeContextForKey:(NSString *)aKey; - (void)reportTag; @end Example Before reporting, you can optionally add further data to the Context object, like a search term, or a file size, or anything else which you want to send to the activity's signature waiting on the server side. In Objective-C: //Create an AternityContext object called "dl_start" which tags the start of "Download" AternityContext *dl_start= [[Aternity sharedManager] tagApplicationWithName:@"Download" withPhase:AternityStartPhase]; //You can also set some values in the context object before reporting it to the server [dl_start setContextValue:self.urlText.text forKey:@"FileName"]; [dl_start setContextValue:[fileAtrrib objectForKey:@"NSFileSize"] forKey:@"FileSize"]; //Report the AternityContext object with its tag and contextuals to the server [dl_start reportTag]; //When user taps Cancel, tell the server that the activity is canceled. //Optionally add contextuals here too. AternityContext *dl_cancel= [[Aternity sharedManager] tagCancelledWithName:@"Download"]; [dl_cancel reportTag]; //Tag and report an error to the server. AternityContext *dl_error = [[AternityAgent sharedManager] tagErrorWithName:@"Download"]; [dl_error reportTag]; In Swift: //Create an AternityContext object called "dl_end" which tags the end of "Download" var dl_end: AternityContext = Aternity.sharedManager().tagApplicationWithName("Download", withPhase:AternityEndPhase) //You can also set some values in the context object before reporting it to the server dl_end.setContextValue(self.urlText.text forKey:"FileName") dl_end.setContextValue(fileAtrrib.objectForKey("NSFileSize") forKey:"FileSize") //Report the AternityContext object with its tag and contextuals to the server dl_end.reportTag() //When user taps Cancel, tell the server that the activity is canceled. //Optionally add contextuals here too. var dl_cancel: AternityContext = AternityAgent.sharedManager().tagCancelledWithName("Download") dl_cancel.reportTag() //Tag and report an error to the server. var dl_error: AternityContext = AternityAgent.sharedManager().tagErrorWithName("Download") dl_error.reportTag() Parent topic Start Using the Aternity iOS SDK to Embed Monitoring in your iOS AppRelated tasksIntegrate the Aternity iOS SDK into your App(Add Breadcrumbs to Troubleshoot Mobile App Crashes (leaveBreadcrumb())Related referenceInitialize the Aternity iOS Mobile SDK Manually (activateWithDictionary)Set the Username with the Aternity iOS Mobile SDK (userNameStr)Set the Location's Site Name with the Aternity iOS Mobile SDK (setSite and setOffSite)Tag an Event in an iOS App (tagApplicationWithName)Set Contextual Data to Report from an iOS App (setContextValue)