JavaScript code for Analytics for Advertising
Advertisers with Advertising DSP only
For Advertising DSP, the Analytics for Advertising integration tracks view-through and click-through site interactions. Click-through visits are tracked by the standard Adobe Analytics code on your webpages; the Analytics code captures the AMO ID and EF ID parameters in the landing page URL and tracks them in their respective reserved eVars. You can track view-through visits by deploying a JavaScript snippet in your webpages.
On the first page view of a visit to the site, the Adobe Advertising JavaScript code checks to see if the visitor has previously seen or clicked on an ad. If the user has previously entered the site via a click-through or hasn’t seen an ad, then the visitor is ignored. If the visitor has seen an ad and hasn’t entered the site via a click-through during the click lookback window set within Adobe Advertising, then the Adobe Advertising JavaScript code either a) uses the Experience Cloud ID Service to generate a supplemental ID (SDID) or b) uses the Adobe Experience Platform Web SDK generateRandomID method to generate a StitchID. Either ID is used to stitch data from Adobe Advertising to the visitor’s Adobe Analytics hit. Adobe Analytics then queries Adobe Advertising for the AMO ID and EF ID associated with the ad exposure. The AMO ID and EF IDs are then populated in their respective eVars. These values persist for a designated period (by default, 60 days).
Analytics sends site traffic metrics (such as page views, visits, and time spent) and any Analytics custom or standard events to Adobe Advertising hourly, using the EF ID as the key. These Analytics metrics then run through the Adobe Advertising attribution system to connect the conversions to the click and exposure history.
Deploying the JavaScript code
The JavaScript library consists of two lines that allow Analytics and Adobe Advertising to communicate with each other. If the Analytics for Advertising integration was completed during the Adobe Advertising implementation, then you should have already received this code with instructions on how to deploy it.
The code
Implementations that use the Experience Cloud Identity Service visitorAPI.js code
<script src="https://www.everestjs.net/static/le/last-event-tag-latest.min.js">
<script>
if("undefined" != typeof AdCloudEvent)
AdCloudEvent('IMS ORG Id','rsid');
</script>
Implementations that use the Experience Platform Web SDK alloy.jscode
<script src="https://www.everestjs.net/static/le/last-event-tag-latest.min.js">
<script>
if("undefined" != typeof AdCloudEvent)
stitchId = AdCloudEvent('IMS ORG Id','rsid').generateRandomId();
</script>
Where to place the code
The Analytics for Advertising JavaScript function must come after the Experience Cloud ID Service but before your Analytics App Measurement code. This ensures that the supplemental ID (SDID) or StitchID is included in your Analytics call.
Validating code deployment
You can perform validation using any packet sniffer type of tool (such as Charles, Fiddler, or Chrome Developer Tools) by comparing the values of the four IDs between the request going to Adobe Advertising and the request going to Analytics, as outlined below.
How to confirm the code with Chrome Developer Tools validate-js-chrome
-
Open Chrome Developer Tools and click the Network tab.
-
Load a website page that contains the Analytics for Advertising JavaScript.
-
Filter the Network tab by
lastand review two rows:
-
The first row is the call to the JavaScript library and is titled
last-event-tag-latest.min.js. -
The second row is the call sending the request to Adobe Advertising. It begins as follows:
_les_imsOrgId=[your_imsOrgId_here]&_les_url=[your_encoded_url]If you don’t see the call to Adobe Advertising, then it might not be the first page view of your visit. For testing purposes, you can remove the cookie so that the next call is the first page view for the corresponding visit:
- On the Application tab, find the
adcloudcookie, and verify that the cookie contains_les_v(last visit) with a value ofyand a UTC epoch timestamp that expires in 30 minutes.- Delete the
adcloudcookie and refresh the page.
- Delete the
-
-
(Implementations that use the Experience Cloud Identity Service
visitorAPI.jscode) Filter on/b/ssto see the Analytics hit.
-
(Implementations that use the Experience Platform Web SDK
alloy.jscode) Filter on/interactto verify that the request payload to the Edge Network containsadvertisingStitchID.
-
Compare los valores de ID entre las dos visitas. Todos los valores deben estar en parámetros de cadena de consulta, excepto el ID del grupo de informes en la visita de Analytics, que es la ruta de la URL inmediatamente después de
/b/ss/.table 0-row-4 1-row-4 2-row-4 3-row-4 4-row-4 5-row-4 ID Parámetro de Analytics Edge Network Parámetro de Adobe Advertising Organización de IMS de Experience Cloud mcorgid_les_imsOrgidID de datos suplementario sdid _les_sdidID de unión stitchId advertisingStitchIDbajo la propiedad_adcloudAnalytics Report Suite El valor después de /b/ss/_les_rsidID de visitante de Experience Cloud mid _les_midSi los valores de ID coinciden, se confirma la implementación de JavaScript. Adobe Advertising envía al servidor Analytics cualquier detalle de seguimiento de clics o visualizaciones, si existe.
Cómo confirmar el código con Adobe Experience Platform Debugger
-
Abre el Adobe Experience Platform Debugger en tu página de inicio.
-
Vaya a la ficha Network.
-
En la barra de herramientas Solutions Filter, haga clic en Adobe Advertising y Analytics.
-
En la fila del parámetro Request URL - Hostname, busque
lasteventf-tm.everesttech.net. -
En la fila Request - Parameters, audite las señales generadas, de forma similar al Paso 3 de “Cómo confirmar el código con Chrome Developer Tools”.
- (Implementaciones que utilizan el código
visitorAPI.jsdel servicio de identidad de Experience Cloud) Asegúrese de que el parámetroSdidcoincida conSupplemental Data IDen el filtro de Adobe Analytics. - (Implementaciones que utilizan el código
alloy.jsExperience Platform Web SDK) Asegúrese de que el valor del parámetroadvertisingStitchIDcoincida con elSdidenviado a Experience Platform Edge Network. - Si el código no se está generando, asegúrese de que la cookie de Adobe Advertising se haya eliminado en la pestaña Application. Una vez eliminada, actualice la página y repita el proceso.
- (Implementaciones que utilizan el código