First page of first visit
However, I also explained some alternative methods for hybrid Analytics. One of them was to make a call to the server and keep all Analytics implementations server-side. In this case, you need to get the SDID from the ECID service using visitor.getSupplementalDataID() and send it to the server in the call. Then, in the Analytics call, you need to add the sdid parameter with this value. I must admit I have never tried this option.
Second page onwards
The fun starts when you switch to pure server-side. As documented in A4T for Batch Delivery API, the response of the Target API call may include a parameter named clientSideAnalyticsLoggingPayload . This is how it looks like in one of the examples I created for the Adobe Summit 2019:
"content": "<img src=\"style\/emea-summit.jpg\" \/>",
The official documentation then tells you to make an empty Analytics call with just the tnta parameter above. However, this will cost you an extra server call. Instead, I recommend that you add the tnta parameter to the Analytics call you would do anyway at the bottom of the page. Do not forget to URL-encode it. Following the previous example, this is the call made by my code (formatted for better reading):
You will notice that the Analytics mid parameter is the same as the Target marketingCloudVisitorId .
A4T or not
I assume you have already provisioned A4T. However, you still need to configure the activities in the Target UI to use A4T. In order to do this, you must select “Adobe Analytics” as “Reporting Source” in the”Goals & Settings” page of the activity:
It goes without saying that you need to configure everything else correctly on that page.
Finally, since you can still configure Target as the reporting source, your code must accept both cases:
- Reporting in Target: no clientSideAnalyticsLoggingPayload in the Target response and no setting of the tnta parameter in the Analytics calls.
- Reporting in Analytics (aka A4T): clientSideAnalyticsLoggingPayload present in the Target response and its value copied over to the tnta parameter in the Analytics calls.
illustration by Ouch.pics