iOS Events with optional data (action and label)

vicente_peris
Silver Contributor
Silver Contributor vicente_peris

Hi Tealium Community,

 

I would like to start implementing  an iOS app biu I have some doubts about events.

 
We have this code in the documents:
 
 
// With optional data
let optionalData = ["someKey":"someValue"]
Tealium.instanceForKey("uniqueInstanceKey")?.trackEventWithTitle("someEvent", dataSources:optionalData)
 
So, would the following code be right to send both action and label inside an event?
 
 
let optionalData = ["event_action":"someValue","event_label":"someValue"]
Tealium.instanceForKey("uniqueInstanceKey")?.trackEventWithTitle("someEvent", dataSources:optionalData)
 
Afterwards, we'd map eventName as eventCategory, event_action as eventAction and event_label as eventLabel in the GA Tag.
 
Best,
2 REPLIES 2

iOS Events with optional data (action and label)

Tealium Employee
Hi @vicente_peris

Yes, that code would be correct to trigger an event to GA.

Craig.
Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.
Highlighted

iOS Events with optional data (action and label)

vicente_peris
Silver Contributor
Silver Contributor vicente_peris

Great @craig_rouse

 

Thank you very much.