AudienceStream Live Events : Missing specific traffic.

Gold Contributor
Gold Contributor

Dears,

 

I have a strange issue I'm breaking my head on for a while now :

 

Setting :

  • I have an app on Android and on iOS.
  • They both have a part in the app that goes to support pages (a website) : in-app browsing. (so no SDK here)
  • These pages areTealium tagged.
  • to identify the in-app traffic from the regular webtraffic, we placed the name of the app in the UserAgent : "ios-app" and "android-app" for each webview.
  • From Tealium the traffic goes to Adobe. I see the traffic entering Adobe from both apps.
  • I see the values of UserAgent in Adobe, so I see what pages are visited from within the android app and iOS app.
  • I have the collect tag in the Tealium profile to spy on the traffic.

 

Now the problem :

In Audiencestraem I don't see the traffic from the Android and I see the traffic from the iOS app.

 

Any suggestions?

 

The differences : Android has SDK5 and iOS has SDK4 for the native traffice, but I'm talking about non-native traffic here.

 

Thanks for thinking,

Philippe

 

8 REPLIES 8

AudienceStream Live Events : Missing specific traffic.

Gold Contributor
Gold Contributor

Hello,

 

Note: I am an employee of the Philippe Vlaemminck (who posted this issue).

 

We have figured out why the Collect calls were not working. I am posting this here so if people run into this issue before Tealium updates the Collect tag template, they know what's causing it.

 

Apparently the Collect tag uses the 'localStorage', and because the value of localStorage was null in our browser, the script failed when trying to use it.

 

In the script is a check to see if localStorage is undefined, like this: if(typeof localStorage != 'undefined' && …. ){…}

But because the value of localStorage is null, the condition passes as true.

I would suggest changing the check to something like if(!localStorage && … ) { … }

This would result in a false if localStorage is either undefined or null. Alternatively just add a check if localStorage === null.

 

The reason localStorage is null is because when the WebView was initialised, it wasn't explicitly told to enable localStorage.

If we add the following line to the code:

webView.getSettings().setDomStorageEnabled(true);

Then localStorage is enabled and the script works just fine.

 

Regardless, I believe the template should be updated to take this situation into account.

I am hoping Tealium will update this soon :)

 

Good luck!

AudienceStream Live Events : Missing specific traffic.

Employee Emeritus

Thank you for the answer and feedback @Sam. We appreciate it! I will also forward your suggestion to the appropriate department.

CC: @philippe_vlaemm 

Remember to give me a kudo if you like my post! Accepting my post as a solution is even better! Also remember that search is your friend.

AudienceStream Live Events : Missing specific traffic.

Tealium Employee

Hey @Sam and @philippe_vlaemm,

 

May I ask some clarifying questions so that I can submit this correctly?

 

I could use some assistance figuring how how this was an issue only on Google (Chrome?) and not on Apple (Safari?). I would seem that if it happened on one browser it would happen on the other. Any insight here?

 

Is there 1 or are there 2 profiles controlling the in-app browsing? I guess 1 since it's technically just a web page, but want to be sure.

 

You mentioned you updated the following line of code: typeof localStorage != "undefined". This belongs to the page performance function "u.get_performance_timing". At the top of this function we declare the variable "data" as an object, we then add many key/values to this object, stringify it, then save it in local storage. So at the least, an object should be saved.

 

Also, the check to see if localStorage!="undefined" would only ever be applicable on the first page view on a new visitor, and even then it would never equal null, it would truly be undefined. Then, after the very first page view the localStorage would be set with an object of data.

 

So I guess what I'm saying is that I need assistance replicating this issue so we can see how a null value is getting set. Of the many clients using this functionality, this is the first report of it so it seems like a unique issue. Any insight you can provide to help determine how this is occurring would be great.

 

Is the site loading the app accessible via a URL outside the app? This would be the best method to help us look into this further.

 

I look forward to the feedback, and please let me know if you have any questions.

 

Cheers,

-Dan

AudienceStream Live Events : Missing specific traffic.

Gold Contributor
Gold Contributor

Hi @dan_george,

 

The issue isn't on Chrome nor Safari. The issue is with the Android WebView for in-app browsing.

To test this we have created a basic Android Application containing a WebView.

This WebView points to a page with Tealium and a Collect tag active in the Tealium profile.

 

With the default settings of the WebView, the Collect tag does not work, because localStorage was equal to null (not undefined).

This must be something that Android WebViews do (at least on some versions/phones).

When you enable DomStorage in the WebView by calling mWebView.getSettings().setDomStorageEnabled(true);

you enable the use of localStorage within the WebView. When this setting is enabled, the Collect tag works fine.

 

 

So by following the next steps, you should be able to replicate the issue:

  1. Create a simple webpage containing Tealium with a profile that has the Collect tag enabled.
  2. Create a simple mobile application containing a WebView pointing to the webpage created in step 1.
  3. Monitor the request somehow, audiencestream, proxy, or enabling debug settings and inspecting the webview through the computer.
  4. Launch the app

 

When launching the app, you should be able to see that the collect tag loads fine, but there is no call being fired to the collect servers, due to an error happening within the collect tag.

 

Good luck!

AudienceStream Live Events : Missing specific traffic.

Tealium Employee

@Sam thanks for the additional details! My knowledge of the Mobile App is a bit limited so I appreciate all the info profided. We'll attempt to recreate this and follow up with our findings.

AudienceStream Live Events : Missing specific traffic.

Tealium Employee

Hey @Sam

 

Without the .setDomStorageEnabled enabled, collect will not work.

 

.setDomStorageEnabled(true) should be enabled to make use of local storage.

 

When we followed the steps you mentioned AND setDomStorageEnabled(true) we see collect dispatches coming through to AS and no errors in console.

 

Can you give that a try (with the defaut template) and report back with your results?

AudienceStream Live Events : Missing specific traffic.

Gold Contributor
Gold Contributor

Hi @dan_george,

 

As I mentioned in my last reply, I have already tested this scenario.

I have confirmed that it does indeed work when DOM storage is enabled.


But as the template checks for the scenario where localStorage is undefined, it should also check for the scenario where it is null. This because the localStorage is null when DOM storage is disabled.

AudienceStream Live Events : Missing specific traffic.

Tealium Employee

Thank you, @Sam I have opened the required development ticket to get this updated.

Public