Expand my Community achievements bar.

SOLVED

2 Appmeasurement instances running on the same page

Avatar

Level 1

Hello,

 

We have 2 Appmeasurement running on the same page with 2 different namespace objects. Upon checking the analytics, the new implemented appmeasurement that is using the new report  suite has much lower hits compare to the old Appmeasurement. We can see on the network tab that the 2 image request fired synchronously. Also the size of old appmeasurement is bigger than the new appmeasurement.

 

Intent is to send data to two different set of reporting suites in the same org's. One currently in place, implemented with existing App measurement (+10 years) . There is another app measurement with improved tags (reduced numbers of tags and remove the age of the tags) .

 

 

Thanks!

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi there,

Thanks for reaching out.


I can see that you're having some issues with two AppMeasurement instances running on the same page. I've investigated the issue and found the following possible solutions:

  1. Use different namespaces for each AppMeasurement instance. This will prevent the two instances from conflicting with each other.
  2. Use the disableSync property to disable synchronous image requests. This will improve performance and prevent the two AppMeasurement instances from blocking each other.
  3. Use the forceSend property to force all hits to be sent to both reporting suites. This may improve the accuracy of your data, but it may also increase the load on your servers.

I recommend that you try the first solution first. If that doesn't work, you can try the second or third solution.

Here is some additional information about each solution:

  • Using different namespaces: Each AppMeasurement instance can be given a unique namespace. This will prevent the two instances from conflicting with each other, even if they are using the same tracking code. To use different namespaces, you need to set the namespace property on each AppMeasurement instance.
  • Disabling synchronous image requests: Synchronous image requests block the page until the image has finished loading. This can cause performance problems, especially if the images are large. To disable synchronous image requests, you can set the disableSync property to true on each AppMeasurement instance.
  • Forcing all hits to be sent to both reporting suites: By default, AppMeasurement will only send hits to the reporting suite that is configured in the tracking code. To force all hits to be sent to both reporting suites, you can set the forceSend property to true on each AppMeasurement instance.

I hope this helps! Please let me know if you have any other questions.

Thanks,

View solution in original post

5 Replies

Avatar

Correct answer by
Community Advisor

Hi there,

Thanks for reaching out.


I can see that you're having some issues with two AppMeasurement instances running on the same page. I've investigated the issue and found the following possible solutions:

  1. Use different namespaces for each AppMeasurement instance. This will prevent the two instances from conflicting with each other.
  2. Use the disableSync property to disable synchronous image requests. This will improve performance and prevent the two AppMeasurement instances from blocking each other.
  3. Use the forceSend property to force all hits to be sent to both reporting suites. This may improve the accuracy of your data, but it may also increase the load on your servers.

I recommend that you try the first solution first. If that doesn't work, you can try the second or third solution.

Here is some additional information about each solution:

  • Using different namespaces: Each AppMeasurement instance can be given a unique namespace. This will prevent the two instances from conflicting with each other, even if they are using the same tracking code. To use different namespaces, you need to set the namespace property on each AppMeasurement instance.
  • Disabling synchronous image requests: Synchronous image requests block the page until the image has finished loading. This can cause performance problems, especially if the images are large. To disable synchronous image requests, you can set the disableSync property to true on each AppMeasurement instance.
  • Forcing all hits to be sent to both reporting suites: By default, AppMeasurement will only send hits to the reporting suite that is configured in the tracking code. To force all hits to be sent to both reporting suites, you can set the forceSend property to true on each AppMeasurement instance.

I hope this helps! Please let me know if you have any other questions.

Thanks,

Avatar

Level 1

Thank you @Hemang35 . I just want to know how we flag this in appmeasurement. "Use the disableSync property to disable synchronous image requests". We are checking the Adobe help and the only thing we can see is disableIdSync.

Avatar

Community Advisor

 

In the AppMeasurement library, disableIdSyncs is the correct parameter for disabling the ID synchronization, and there isn't a separate parameter specifically named disableSync.

However, if you want to disable synchronous image requests for Adobe Analytics specifically, you can use s.loadModule("Media") followed by s.Media.trackWhilePlaying = false to disable tracking while the media is playing. These properties, when set to false, will disable the tracking of media data during playback, effectively disabling any synchronous requests.

In the context of the Visitor ID service, setting disableIdSyncs to true will disable all ID syncs. Here is an example of how to do it:

 

Visitor.getInstance ("Insert Experience Cloud organization ID here", {
  ...
  disableIdSyncs: true, // Disable ID synchronization
  ...
});

 

 

This is usually done to improve website performance as ID syncing may involve many network calls, which can slow down a website.

Remember to test this on your staging environment before implementing it on your production website to ensure it works as expected.

Avatar

Community Advisor and Adobe Champion

First off, you have absolutely confirmed that the two Launch properties have the object completely separated, that there is no potential corruption between the two implementations?

 

Adobe is missing a lot of documentation on how to actually use a custom object.. sure, they say you can do it, but I've never seen any instructions on how to accomplish it....

 

My concern is that some data intended for the new tracking/suite is somehow still going to the old suite.

 

Did you see a jump in values when you implemented this double implementation?

 

How familiar are you with scripting and debugging in your browser's console... you may need to really dig into this to try and see what is happening...

 

I have never managed to figure out how to properly change the tracking object, so I've never had your particular scenario...

 

If you are willing to share your URL (even if in a private message) I can try and see if I can spot anything odd....

 

I assume these are both client based tracking, not one on WebSDK?

Avatar

Community Advisor and Adobe Champion

@Jake143 I want to confirm that in your implementation you have created separate tracking objects?

https://experienceleague.adobe.com/docs/analytics/implementation/vars/functions/s-gi.html

 

I've been chatting with someone at Adobe... apparently you don't need two AppMeasurement files... simply declaring multiple tracking object, and referencing that object directly is the correct process:

 

// Instantiate two separate tracking objects to two different report suites
var s = s_gi('examplersid1');
var z = s_gi('examplersid2');

// The s object and z object contain their own independent Analytics variables simultaneously
s.pageName = "Example page name 1";
z.pageName = "Example page name 2";

// Send data to the examplersid1 report suite
s.t();

// Send data to the examplersid2 report suite
z.t();

 

 

Hope this helps!