Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Analytics Coffee Break: On Monday, January 30 at 10am PT, the NOAM User Group led by Jennifer Dungan and Jeff Bloomer will be joining us to answer your Analytics related questions. To register and for more information, follow the link to the right.
SOLVED

Mapping eVar to mobile 'trackAction' ContextData variable via Analytics Processing Rules...but with no access to Mobile SDK

Avatar

Level 2

Hi. I'll try and make this as concise as possible...I've run into a brick wall/runaround in trying to find any usable info in Adobe online documentation. I am the Adobe Analytics Admin for my company — that is I manage Web-based AA via Adobe Launch, yet only work with the Mobile Team on occasion. Rarely do they need for me to do much with their Analytics implementation, but now I need some help with making the mobile 'trackAction' contextData variable available for reporting in Adobe Analytics Workspace.

— So here's what I DO KNOW:

  • I know that in order to make the mobile contextData variable 'trackAction' which currently exists on our mobile side) available to be engaged in Analysis Workspace reports, the 'trackAction' contextData variable must first be mapped to an eVar on non-mobile side of Adobe Analytics via Processing Rules.
  • I've been through this process previously with other eVar-to contextData variables, however, those circumstances were such that the mobile developers were creating their contextData variables to match our non-mobile eVars, so it was pretty straightforward.

— And here's what I DON'T know:

  • Unfortunately now the tables have been turned and I'm struggling to know how exactly I should implement the 'trackAction' data element on my non-mobile side to create an eVar which will be properly mappable to the mobile side of AA.
  • Our Mobile Team works with the SDK5 exclusively and doesn't really touch analytics, nor Launch. I manage the analytics implementation of our mobile apps along with that of our website through a global Launch property which was created prior to SDK5, so it is set as a Web Property and not a Mobile Property, thus I don't have the more recent mobile-centric and SDK5-friendly tools which make configuring for things like mobile actions and events so much more straightforward.

So, given that I am obviously not a mobile developer and have no access to our mobile development back end, I'm hoping that someone here in the community can throw some knowledge my way to give me some idea of how to configure a web property-based data element to jive with a mobile-based contextData variable via Processing Rules. Thanks for any help you can provide.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Ok, going to go through this piece by piece... it's strange that a.action isn't available to you... there should be based on that code...

 

What about plain old "actionname"? a.action and actionname are both set for us (maybe it's a difference in code bases? We use React Native)

Jennifer_Dungan_0-1671043422965.png

 

Do you happen to know what your apps are coded with, I don't see any samples in the Adobe SDK documentation that look exactly like that... perhaps this is some sort of custom extension code that your developers are using, and there is a global function that connects with this... 

 

Looking at your processing rule start... you are looking specifically for a context variable with a value of "log_addToWallet_pressed" but right now, that doesn't look like it should be a context variable... (again, unless this code is a custom 

extension that is actually setting that as a value.... )

 

Context Data should be key/value pairs, something like:

 

var contextData = new Dictionary<string, string>();
contextData.Add("key", "value");
contextData.Add("key2", "value2");
contextData.Add("key3", "value3");
ACPCore.TrackAction("action name", contextData);

 

 

This should result in your a.action / actionname being set to "action name" and on that same call, three context variables are sent (key, key2 and key3) and the values of those keys are the values... etc.

 

It might actually help to see what the actual analytics call looks like.

 

For instance, in my raw analytics call, I see something like:

 

"payload": {
    "ACPExtensionEventUniqueIdentifier": "...",
    "ACPExtensionEventNumber": 66,
    "ACPExtensionEventData": {
      "contextdata": {
        "site.Context1": "value1",
        "site.Context2": "value2",
        "site.Context3": "value3"
      },
      "action": "some action"
    },
...

 

 

So I can actually see the separation between the action name and context variables. By seeing the raw data, it does help understand how to build your rules.

 

So back to your specific question around your rule... IF you do have a context variable called "addToWallet" and the value is "log_addToWallet_pressed" then it should work... but just be sure that this context variable and value is only set on actual actions... 

 

Basically think of the conditions as simple identification that will trigger the corresponding actions...

 

Now the Actions or "Then do the following"

 

This is where you want to set your dimensions and  events that correspond to the identified action.

 

So I'm going to come up with some really silly examples here... but let's say when "log_addToWallet_pressed" happens (assuming this is only set when that button is pressed), you want to trigger event1, event2, and set eVar1 to "yay money" and prop1 to "wallet"

 

Jennifer_Dungan_1-1671046911438.png

 

This is assuming you are setting everything directly...

 

Normally you would also map context variables into your dimensions.. or even add additional Action level conditions (only ONE condition can be added in this context); such as:

 

Jennifer_Dungan_2-1671047325706.png

 

With Mobile Apps you don't use Data Elements... Web and App Launch Properties are so different, you don't structure them remotely the same.

 

In a web property, you create a Data Element.. and that uses Javascript to get some value (either pull it from a value on the page, or pull from a cookie, or you have some custom JS code that you set, etc...) then you have a tracking rule where you add the Data Element to your direct eVar or prop, etc..

 

You don't do this on Mobile Apps... the context data is set in the app, and you use processing rules to set them to your eVars and props after Adobe receives the call; or you can set specific values (without a context variable) based on specific mappings like I showed above with "Custom Value"

 

The control you have in a Mobile App Property is a fraction of the functionality that you have in a Web property.

 

Yes, there are "Data Elements" in a Mobile App Property... but what you can do with them is severely limited.. the only thing I managed to do was concatenate some context variables.. which I can do in Processing Rules.. but since I had no "condition" logic in Launch for this, I ultimately gave up trying to use it....

 

I suppose if you wanted to set a hard-coded prop or eVar such with a value of "mobile app" (to distinguish all mobile app calls from web calls, I supposed you could.. but you might was well do that will processing rules and keep everything in one place....)

 

 

The main point is.. there are web specific extensions.. there are mobile app specific extensions.. you can not mix them in one Launch Property... and how you tag a site vs an app (technology wise) is completely different...

 

What you can keep the same is the suite (pass web and app data into the same suite), and you can control the values, naming syntax, events that fire per action, etc consistent....

 

As I mentioned in my first post, since I am also using a "Global Suite" that contains web and app traffic into one suite; I use the a.appid condition to ensure that my web traffic goes to Adobe as it was set in launch (no processing)... only my apps should be running the processing rules (with the exception of a few old sites that are not going through Launch that have some issues - I use some processing rules to fix those until the site itself can be fixed). 

 

I have multiple Launch Properties, I have one for my Core Websites that run React, I have another for the Core Sites that run on .net, I have properties for each of the white label "extended sites" that we use, then I have another one for Mobile Apps.

 

Keeping the code bases separate means that yes, I have to go and add rules or dimensions multiple times for each variant.. but it also means that I can keep the different code bases clean and separate from one another (which is worth it for me)

View solution in original post

7 Replies

Avatar

Community Advisor

Hi, first, I am not really sure what you mean by "trackAction context variable".... trackAction is a function (the equivalent of s.tl() on the web)... the same way trackState is a function (the equivalent of s.t() on the web)... both of these functions attach context data for mapping to your dimensions....

 

When a trackAction is called, it looks something like this:

MobileCore.trackAction("loginClicked", additionalContextData);

"loginClicked" is the equivalent of "custom link name" in your s.tl() call

s.tl(this,"o","loginClicked");

The additionalContextData is basically dimension values passed as context, that you then map using processing rules.

 

 

For instance, in my implementation, I would set up a rule for the above as:

Jennifer_Dungan_0-1670976912354.png

 

 

The first "a.appid is set" is just a little protection to ensure this rule is ONLY run for my mobile app (and not my website) - this is something that is set by native apps... (if you have a value in "App ID" in your reporting suite for your mobile app hits, that means it's being set).

The second condition checks for the action (or "click name"), in this case "loginClicked"

 

Now that I have my conditions, I then set the rules I want to run.. this is where I would map the data sent in the additionalContextData into my props and eVars, and depending on my rules, I can set events here too.

 

The "Action Name" will be automatically set by Adobe (sadly it will look like this in your reports: "AMACTION: loginClicked" - you cannot get rid of AMACTION:)

 

You can set eVars through hard-coding if you don't have a context variable... as in for the "loginClicked" action, set eVar1 to "Sample Value".. or if you are being sent some context variables you can map those.

 

 

However, you really need to separate out your Launch properties... one for web, one for mobile app (they can send to the same global tracking suite) but you cannot install the proper mobile app extensions in the Web Property. Even when tracking to a global suite, and significant code or infrastructure differences should have it's own property... or you will drive yourself crazy trying to make it all work... and since Mobile Apps require completely different integration you cannot mix those.....

 

For your website, you don't need to use processing rules to set the values... leave all that work for Mobile Apps.... if you try to do everything in processing rules you will seriously hurt your ability to test your website.... at least for Mobile App there is an extension called AEP Assurance (or Project Griffon) so that you can test the context data AND the post-processed data... that doesn't exist for web properties. Just make sure you know what values should be set to your dimensions, set them normally for web, then use processing rules to set them for your app.

 

Also, there really isn't a lot of control in the Mobile App Property, I pretty much use it exclusively to set the tracking suite and manage the extensions..... ALL tracking values I set in Processing Rules using Context Variables.

 

Our developers also work exclusively in SDK5 (and have for the past 2+ years)... I work closely with them to make sure that all my context data is set as needed so that I can make efficient processing rules; it might be worth making a friend on your dev team 🙂

Avatar

Level 2

@Jennifer_Dungan Thank you so much for your thoughtful reply! And I apologize for the initial confusion with the "trackAction context variable" reference (I actually meant to say "trackAction Context Data"). I was pretty sure that I was on the right track but there are still a couple of knowledge gaps I have which still need to be filled, so if you'll allow me to bounce a bit more off of you I'd really appreciate it.

The scenario we're working here is to capture the user clicks tied to a certain button function in a mobile app. Here's the actual code hook from the mobile developers that I'm looking to capture:

void _logAnalytic() {
locator<Analytics>() .trackAction('log_addToWallet_pressed');
}

My initial thought was to create a GENERAL trackAction Data Element that I could apply to an eVar and map to its associated Context Data function via Processing Rules, so that ANY 'trackAction' function could be pulled into Analytics. However, yesterday I discovered that no 'a.action(Context Data)' entry appears in the 'CONTEXT VARIABLES' section of the dropdown selection list in Processing Rules (I assume this means that the mobile team hasn't configured or activated it in the SDK5 controls, but that's just a blind guess).

At any rate, as of right now, the only thing that I have to work with in that list is the actual Action Name for the trackAction in question...

log_addToWallet_pressed

...which is already an available items of the "Action Name" Dimension in Analysis Workspace, although currently it's showing zero instances, hense, the need to make this tie-in through Processing Rules. But instead of creating an all-encompassing 'trackAction' Dimension, I'll have to settle for one to satisfy the specific need with "log_addToWallet_pressed.":

So, with all that said, would it work to construct the Processing Rule entry like this?

2022-12-14_adobe-exp-league-question.png

...but if so, what would be the corresponding "Then do the following"? I have created a 'trackAction' eVar, but I'm not sure what to do with regard to the Data Element which would inform it. And I believe that's where the issue of lumping our Web and Mobile into a single Web launch property comes through to bite our collective behind, because in a Mobile Launch Property, the configuration of a MOBILE Data Element is easy (I know this because I have an instance of a Mobile Property in Launch but it's not connected to anything).

So, I would think the Data Element would have to be configured with Custom Code, but couldn't guess exactly what it should be.

Any other ideas? Documentation? I know I'm asking a lot but stuff like this has been a thorn in my side for a very long time.

Thanks again for your help!

Avatar

Correct answer by
Community Advisor

Ok, going to go through this piece by piece... it's strange that a.action isn't available to you... there should be based on that code...

 

What about plain old "actionname"? a.action and actionname are both set for us (maybe it's a difference in code bases? We use React Native)

Jennifer_Dungan_0-1671043422965.png

 

Do you happen to know what your apps are coded with, I don't see any samples in the Adobe SDK documentation that look exactly like that... perhaps this is some sort of custom extension code that your developers are using, and there is a global function that connects with this... 

 

Looking at your processing rule start... you are looking specifically for a context variable with a value of "log_addToWallet_pressed" but right now, that doesn't look like it should be a context variable... (again, unless this code is a custom 

extension that is actually setting that as a value.... )

 

Context Data should be key/value pairs, something like:

 

var contextData = new Dictionary<string, string>();
contextData.Add("key", "value");
contextData.Add("key2", "value2");
contextData.Add("key3", "value3");
ACPCore.TrackAction("action name", contextData);

 

 

This should result in your a.action / actionname being set to "action name" and on that same call, three context variables are sent (key, key2 and key3) and the values of those keys are the values... etc.

 

It might actually help to see what the actual analytics call looks like.

 

For instance, in my raw analytics call, I see something like:

 

"payload": {
    "ACPExtensionEventUniqueIdentifier": "...",
    "ACPExtensionEventNumber": 66,
    "ACPExtensionEventData": {
      "contextdata": {
        "site.Context1": "value1",
        "site.Context2": "value2",
        "site.Context3": "value3"
      },
      "action": "some action"
    },
...

 

 

So I can actually see the separation between the action name and context variables. By seeing the raw data, it does help understand how to build your rules.

 

So back to your specific question around your rule... IF you do have a context variable called "addToWallet" and the value is "log_addToWallet_pressed" then it should work... but just be sure that this context variable and value is only set on actual actions... 

 

Basically think of the conditions as simple identification that will trigger the corresponding actions...

 

Now the Actions or "Then do the following"

 

This is where you want to set your dimensions and  events that correspond to the identified action.

 

So I'm going to come up with some really silly examples here... but let's say when "log_addToWallet_pressed" happens (assuming this is only set when that button is pressed), you want to trigger event1, event2, and set eVar1 to "yay money" and prop1 to "wallet"

 

Jennifer_Dungan_1-1671046911438.png

 

This is assuming you are setting everything directly...

 

Normally you would also map context variables into your dimensions.. or even add additional Action level conditions (only ONE condition can be added in this context); such as:

 

Jennifer_Dungan_2-1671047325706.png

 

With Mobile Apps you don't use Data Elements... Web and App Launch Properties are so different, you don't structure them remotely the same.

 

In a web property, you create a Data Element.. and that uses Javascript to get some value (either pull it from a value on the page, or pull from a cookie, or you have some custom JS code that you set, etc...) then you have a tracking rule where you add the Data Element to your direct eVar or prop, etc..

 

You don't do this on Mobile Apps... the context data is set in the app, and you use processing rules to set them to your eVars and props after Adobe receives the call; or you can set specific values (without a context variable) based on specific mappings like I showed above with "Custom Value"

 

The control you have in a Mobile App Property is a fraction of the functionality that you have in a Web property.

 

Yes, there are "Data Elements" in a Mobile App Property... but what you can do with them is severely limited.. the only thing I managed to do was concatenate some context variables.. which I can do in Processing Rules.. but since I had no "condition" logic in Launch for this, I ultimately gave up trying to use it....

 

I suppose if you wanted to set a hard-coded prop or eVar such with a value of "mobile app" (to distinguish all mobile app calls from web calls, I supposed you could.. but you might was well do that will processing rules and keep everything in one place....)

 

 

The main point is.. there are web specific extensions.. there are mobile app specific extensions.. you can not mix them in one Launch Property... and how you tag a site vs an app (technology wise) is completely different...

 

What you can keep the same is the suite (pass web and app data into the same suite), and you can control the values, naming syntax, events that fire per action, etc consistent....

 

As I mentioned in my first post, since I am also using a "Global Suite" that contains web and app traffic into one suite; I use the a.appid condition to ensure that my web traffic goes to Adobe as it was set in launch (no processing)... only my apps should be running the processing rules (with the exception of a few old sites that are not going through Launch that have some issues - I use some processing rules to fix those until the site itself can be fixed). 

 

I have multiple Launch Properties, I have one for my Core Websites that run React, I have another for the Core Sites that run on .net, I have properties for each of the white label "extended sites" that we use, then I have another one for Mobile Apps.

 

Keeping the code bases separate means that yes, I have to go and add rules or dimensions multiple times for each variant.. but it also means that I can keep the different code bases clean and separate from one another (which is worth it for me)

Avatar

Community Advisor

Another thing.. are you sure that your developers are actually triggering a trackAction? And not a trackState with a "trackAction" context variable?

 

If it's the latter, they they will be inflating your page views... so you would want that fixed asap!

Avatar

Level 2

@Jennifer_Dungan, Sorry for the lapse in my replies, but I am happy to say that thanks to your helpful input last week, I was able to "fill in the gaps" enough to have a cogent conversation with our mobile developers. We have finally nailed down the pertinent Context Data methods that I needed to identify in order to track our mobile app actions properly!

I still have a bit of work to do before I'll feel truly successful, but a huge veil has been lifted in terms of my overall knowledge of the way in which AA Mobile intersects with AA Web, thanks to your help!

(We STILL have to get our mobile implementation into it's own Launch property, but that'll happen soon enough as well...)

Anyway, thank you again and here's wishing you a wonderful Holiday Season!

Avatar

Community Advisor

No worries, I figured you might have been mulling over the information with your team, and I know it's holiday season. 

 

Let me know if I can help further. I was in your shoes just a few years ago trying to start a completely fresh mobile tracking for our apps (previously we were using a Native wrapper around a website... so we weren't using SDK calls, but all web based).

 

It can be a bit of a hard leap to get from Web to SDK... and at the time most of the documentation was still based on the old SDK 4.x and mobile services... so I had to do a lot of ground work to figure out SDK 5.x and processing rules....

Avatar

Level 2

OH I AM RIGHT THERE WITH YOU regarding that rather famous lag in documentation updates a couple of years ago! Adobe seems to be doing much better now but there's STILL a lot of outdated info still attached to official channels, but I guess I'm used to it by now! 😫

 

Thanks again and Merry Christmas, Jen!