TrackAction and TrackState at same time



Hello Adobe Analytics,

Quick Question,

Has anybody tried to use a trackAction and trackState simultaneously on mobile apps ?

I need to get to know the name of the page (screen / state) the action is launched.

I've never tried this before, but we are having some trouble with this , and I'm not sure this is feasible - since for me those methods are 2 very different things.

If not, I guess it's still possible to send a context data with the name of the screen on the TrackAction, like on DTM with Custom links for getting to know the pageName where these come from.

Or vice versa, do a TrackState with a contextData on the event.

Our need is the following  :

We have a placed the trackaction call on the Login screen to capture the login success event. Also on Order Placed Success screen we have placed the trackaction call for the order placed success event. Because of which we are not getting pageview for these screens. Is it advisable to have trackaction and trackstate call on these screens to capture a pageview and event?

Cheers !




I only use trackState and capture everything in this one. I don't see any reason to use trackAction except the case where you don't want to count it as screen view..

You should be able to achieve everything  under trackState..




Check out the documentation for sending in along additional data in a trackAction: Track App Actions

You can put the current page at the time of the action into the context data, and then map it to your desired evar/sprop. Then you'd be able to see the pages/screens on which your action happened.




Your implementation is not complementing your Analytical requirement,

You are looking for Page view in trackaction call is just like looking for page views in s.tl call. The key property of the trackaction call is to track the action and discard the pageinfo.

If you want to analyize Page specific with the all you would need to either use trackstate call which captures page info or use a custom variable to do so in the trackaction call.

You can fire the trackaction for the actions like Order click, check out , log in and with that activity complition you can fire the subsequent trackstate Call for the result screen  like Order checkout, Order confirmation or Logged In screen.

Happy tracking.






I understand what you're trying to do.  You're simply wanting to capture the pageName on your success events.  You could actually approach this in one of two ways.

  1. If you want to simply add pageName to a trackAction() call without capturing the remainder of your global variables that fire on every page view, you can simply fire the page name value you wish to track within a context value pair.  For example: set a.pageName to the value you would prefer to see.  When configured correctly, within your debugger you should see a.pageName set to the value you specified and further down the page, you will also likely see pageName with the name of your app.  You should then be able to capture a.pageName in Adobe Mobile Services using the Manage Variables and Metrics tab to assign a.pageName to an eVar and/or prop of your choice.
  2. You could also fire a trackState() call along with a specific context variable identifying the action the user just performed.  Example: app.event.eventName: login success.  Then, you can write a Processing Rule that says: If app.event.eventName equals login success, then Set Event <eventX> to Custom Value 1.

Option 1 lets you still fire trackAction() while collecting your desired pageName information, while option 2 allows you to fire all variables associated to trackState() along with any associated event(s) you need.

Happy to answer any additional questions you may have.  We’ve been doing this for a while now in our own implementation.