iOS Events with optional data (action and label)

Gold Contributor
Gold Contributor

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)

Moderator
Moderator
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.

iOS Events with optional data (action and label)

Gold Contributor
Gold Contributor

Great @craig_rouse

 

Thank you very much.

Public