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
BedrockMission!

Learn more

View all

Sign in to view all badges

TrackAction and TrackState at same time

marion33678522
Level 8
Level 8

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 !

5 Replies
sibelakcekaya
Level 2
Level 2

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

nikitaf2673776
Level 5
Level 5

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.

suneeshkachroo
Level 4
Level 4

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.

thanks

Saneesh

jeff_bloomer
Level 8
Level 8

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.

Thanks!

Jeff

ArturoPinzon
Level 2
Level 2

Hey Jeff, i`m viewing this post a bit late, but i landing here searching a solution for a similar scenario on a mobile app.

I have some doubts, to get the pageName value on a trackstate like a parameter its possible just adding a context data of pageName, but in fact i can remember saw on Adobe Documentation a reference about this where its possible add pageName Through  a default value "page.name" but when i tried not works, not any info on Adobe, so i think this need a context data to capture pageName and later pass it to an Evar or Prop right?

 

And my last doubt, is about that pageName showed in debugger like charles that it contains the app build name, this cant be erased or replaced with the expected value? When i try to do a brekdown on Adobe between PageInteracions (Evar) with PageName it results on 0 matches, that make me think about that value is being ignored by Adobe Post Processing.

 

ArturoPinzon_0-1616792158079.pngArturoPinzon_1-1616792198520.png