Expand my Community achievements bar.

Tracking wrapped web pages in mobile apps

Avatar

Level 2

Our developers are looking at including wrapped web pages (with the Adobe Analytics JavaScript tags on them) in our mobile app.  Is there documentation that shows how to make sure they are included in the mobile app tracking?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

12 Replies

Avatar

Community Advisor and Adobe Champion

So this is an interesting, and unfortunately tied specifically to your custom implementation scenario; so there's no real documentation....

 

The thing is, mobile app tracking has metrics like App Version and Lifecycle metrics which cannot be a part of your web JS tracking... but I understand that logically you would want to track those pages within your own "App traffic" definitions....

 

First, I assume you are passing the ECID values from the app to the webview pages, and that your website is reading those parameters and making sure to identify the user as the same ID.

 

Now, there are different ways to do this, but it would still be customized...

 

There are different ways to identify this.. you could use a custom parameter passed on Webviews to indicate that your App was loaded within the app (this of course might end up getting shared as a link which would impact your ability to track reliably).

 

Here is what I use, but it's a bit more involved. I actually used a trick used by a lot of social media apps, I had our developers append a custom value to the User Agent within the app. Basically, all webviews through an app use your default browser to render the content (the content will be identified as that browser / OS)... appending to the end a value like "[my app]" doesn't change how Adobe / Google / etc identify the app, but you can actually create a rule to check for "[my app]" and code in special tracking for anything loaded in this scenario. If on your website you see this User Agent variation, you can set a dimension that you use in segmentation to identify web from app (however you are determining that)

Avatar

Level 2

Thanks for that answer.  I especially like the user agent alteration.  We have a different report suite for web and mobile app.  I'd like to change between them depending on user agent.

 

I'm not as familiar with web views.  Would the tracking be the same if the web pages were "sliced" so that they don't have the navigation or footer?  The screen template essentially frames in the main part of each page.  I'm wondering if (conceptually) web views are that easy.

 

 

Avatar

Community Advisor and Adobe Champion

Trying to switch the tracking suite programatically can be done, but this can become a potential failure point... personally I wouldn't separate the tracking between web and apps... that is really just making your life harder when you need to pull overall stats (it's easier to segment data than to roll it up - Adobe's "rollup suites" don't work great, they were the solution many many years ago, they no longer recommend them for most implementations).

 

I use a Global Suite model (rolling 30+ sites, 3 apps, and many companion sites) into one suite, then use Virtual Suites to segment to "Core Web", "Mobile App", "AMP", etc for each site... allowing me to pull the subset of data that is needed, or all the data combined. But ultimately, the choice is yours in how you want to track and separate our your data.

 

If you do want to go the direction of separate suites, you will have to modify your web tracking in one of two ways....

 

Use Adobe Launch to detect the use of the "app webview" as above, and change the tracking accordingly to set the s_account value to the correct suite... or you can get your developers to detect it, and load a different Adobe Launch property onto the webpage that is set up to track to your mobile app suite (again, some core tracking elements like App Versions and Lifecycle metrics will not be included in any data collected this way)

 

As for your question

would the tracking be the same if the web pages were "sliced" so that they don't have the navigation or footer? 

That is completely up to how your developers coded it... if you devs are hiding content such as the footer, then it sounds like they are already passing something to the page to tell it to load differently... you might be able to leverage that... or as above, as the developers to change the Launch property in that scenario.

 

Our webviews don't do anything special, no hiding of elements, no change it logic... they could if we wanted to... but since we have so few, most of our pages are built right into the app (at least in our more recent apps, older versions, may not have the pages and open as webview), so most webviews are of external sites; and my detection within our site allows me to record it appropriately.

Avatar

Level 2

Thanks for the info on tips on detecting when the mobile app is using the website.  I get the Global suite and subsequent Virtual suites.  It makes sense.  I guess I got a bad taste in my mouth for Globals when I had to use one before Virtual suites existed.

 

There are two reasons I'd attempt to switch the tracking suite programmatically:

- I'm more interested in observing the complete mobile app visit than seeing overall stats (again, no Global suite).

- I want to keep the sanctity of the user (we get a lot of questions about them).

 

When you mentioned passing the ECID, is that via a query parameter?  Is that enough to keep the same visit integrity in the data?

Avatar

Community Advisor and Adobe Champion

Oh I hear you... the old rollup suites weren't all that good

 

And if you were doing globals a different way, then it really does come down to making sure there is a clear understanding of how the data fits together.

 

So if you are going to switch the suite programatically using Launch, I can help you with that... technically I do this... but only so that I can force tracking to go to QA in the "Prod Environment" when our internal staff is using preview mode.

 

Basically, we're a newspaper site, and our internal staff can actually preview articles through a specific function (but I don't want to track these articles as traffic, so I did make some programmatic changes to force the suite to QA instead of Prod, despite being a prod environment... I actually have my suites coded into a Custom Code Data Element, then I populate the Analytics extension using the Data Element... This does mean that I no longer see what each dimension is when in the Set Variables mode... I just see "eVar1" instead of "eVar1: Name of eVar"... it does make tagging a little harder (just warning you).

 

But again, if your developers are already running code that supports dropping the headers / footers / etc content on the page, you should be able to have them just use a completely separate Launch property, then you don't have to create a lot of code inside your one suite to handle variances.... 

 


When you mentioned passing the ECID, is that via a query parameter?  Is that enough to keep the same visit integrity in the data?


It's supposed to... this is the Adobe solution for maintaining App to Web traffic. There is an app function that is supposed to modify the URLs opening the website to append ECID information - so that the tracking on the website can read it, overwrite the ECID identification in the web, and make sure that in the suite, that user is treated as one UV...   This is also used for cross domain ID sharing.

 

I haven't personally used this, as we have so little traffic direct from App to Web, it's not been a priority.. but is something I eventually want to implement.

 

https://experienceleague.adobe.com/docs/experience-platform/edge/identity/id-sharing.html?lang=en

 

https://experienceleague.adobe.com/docs/platform-learn/implement-mobile-sdk/app-implementation/web-v...

 

Let me know if I can help you any more with programmatically switching your traffic suite.

Avatar

Level 2

So we're not using Data Collection for tagging.  Instead we're using a third party tag manager.  We'll switch when we eventually go to Web SDK tagging.  For now, it's essentially manual.


I've got the passing of the ECID to the wrapped web pages.  But how do we overwrite the new one in the wrapped page appmeasurement tagging?  Is it as simple as setting a certain ECID variable?  (I'd love to use appendIdentityToUrl, but we don't use Web SDK.)

Avatar

Community Advisor and Adobe Champion

Hmm that I am not sure about... you are using a third party tagging system, how are you setting the ECID today? Are you still leveraging the Adobe Visitor ID Service, or are you not actually using ECID, but passing a custom visitor id via the vid parameter maybe?

 

This sounds like a custom solution, and I know little about your setup to help guide you, but I will try my best....

Avatar

Level 2

Sorry for the confusion.  I promise this is much, much simpler than you might be thinking.  I probably shouldn't have mentioned the third party tag manager.  Essentially we've put the Adobe JavaScript tags of Visitor.js and appmeasurement.js on our web pages.  ECID is set by Visitor.js (Adobe Visitor ID Service).

 

I was thinking that we'd put some conditional logic to update the ECID when the web page sees that a visitor is in the mobile app.  We just don't know the code to update it.

Avatar

Community Advisor and Adobe Champion

Ah Gotcha, you are just using the third party system to implement a "traditional" host JS files, set the variables and sent the tracking!

 

thought that the Visitor ID service was supposed to automatically set the ECID cookie based on the passed value, but someone else was having issue with that just recently... 

 

You could try to create some custom code to overwrite the s_ecid cookie manually... you just have to make sure that code runs before your tracking occurs.....

Avatar

Level 2

Would appendVisitorIDsTo () work in this instance?

https://experienceleague.adobe.com/en/docs/id-service/using/id-service-api/methods/appendvisitorid

(we're kind of out of my wheelhouse with this, but it seems to keep turning up when I search on this topic)

 

Avatar

Community Advisor and Adobe Champion

Hi, 

 

appendVisitorIDsTo() is more for website to website... but you are going Mobile App to Web.. it has its own function.... which I believe is appendVisitorInfoForURL

 

 

https://developer.adobe.com/client-sdks/home/base/mobile-core/identity/tutorials/id-sharing/