We had a app developer here for a couple setting up adobe tracking for our new app (before I came onboard, no idea what happened).
He left us with about 30 or so events and documentation that looks like this:
event55 | Select Your Installation Manually | a.action=team.selectyourinstallationmanually | Select Your Installation Manually | [contextData setObject:@("select your installation manually" forKey:@"selectyourinstallationmanually"]; | Toggle |
event76 | Enable SMS Notifications | a.action=team.enablesmsnotifications | Enable SMS Notifications | [contextData setObject:@("enable sms notifications" forKey:@"team.enablesmsnotifications"]; | Toggle |
event59 | Promotional Updates | a.action=promotionalupdates | Promotional Updates | [contextData setObject:@("promotionalupdates" forKey:@"team.promotionalupdates"]; | Checkbox |
But my dev team said that [contextData setObject:@("enable mail notifications" forKey:@"aafes.mailnotifications"]; doesn't make sense and wouldn't implement it. I've also never seen it written this way but wanted to see if it does to anyone else or what is the right way to this up? (I've substituted "team" for the company name)
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Hi jha0024, the example above you provided above would be the correct syntax. For example: instead of doing
[contextData setObject:@"login_status" forKey:@"mobile.login_status"];
you may do
contextData['mobile.login_status'] = 'login_status'
Hi andersonjh - apologies for the delayed response. I'm not completely sure what you're trying to do. Can I trouble you provide a little more context and perhaps some end-results of what you're trying to accomplish so we can get you a prompt response?
Absolutely. We're trying to implement context data variables into our mobile app. Historically, I've only seen script like this,
s.contextData[‘mobile.login_status’] = ‘Logged In’;
but the consultant gave us implementation specs that looked like the first post. I'm not a developer so I want to be careful but, in my understanding, his technical implementation specs can't actually be used. Meaning, we can't set a variable for when people login as
[contextData setObject:@("login_status" forKey:@"mobile.login_status"];
Or can we? Which of these two examples can actually be coded into the app and set as a data element? Or can neither be used?
Hi jha0024 - May I ask if you are asking about the Android or iOS app implementation? If it is iOS, is your application written in Swift or Objective-C.
[contextData setObject] is Objective-C syntax. The example you provided: s.contextData[‘mobile.login_status’] = ‘Logged In’, looks like a Swift syntax.
Great to know.
It's actually being written in React Native. Do you know the syntax for that?
Hi jha0024, the example above you provided above would be the correct syntax. For example: instead of doing
[contextData setObject:@"login_status" forKey:@"mobile.login_status"];
you may do
contextData['mobile.login_status'] = 'login_status'
Thanks. 2 questions. do i need to have s. or p. etc in front of the contextData? and = 'login_status" can be replaced by whatever term we define as the login status or not? such as 'Logged In" or does it need to be = 'login_status' ?
1. It depends on where you are inserting this line of code in the application. The contextData variable may be a field of another object (s or p). The developers should recognize whether they need it or not.
2. Yes, I used 'login_status' in my example to be consistent with the String used in the setObject call from Objective-C. In actual implementation it is likely that it is a value of current login status, for this particular example.
Awesome. Thanks for your help on this.
Views
Likes
Replies