JavaScript code for Analytics for Advertising
Annonceurs avec Advertising DSP uniquement
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. Si l’intégration Analytics for Advertising a été terminée lors de la mise en œuvre d’Adobe Advertising, vous devez déjà avoir reçu ce code avec des instructions sur la manière de le déployer.
Le code
Implémentations qui utilisent le code visitorAPI.js d’Experience Cloud Identity Service
<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>
Implémentations qui utilisent le code Web SDK Experience Platform alloy.js
<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>
Où placer le code
La fonction Analytics for Advertising JavaScript doit se placer après le service Experience Cloud ID, mais avant le code Analytics App Measurement. Cela permet de s’assurer que l’ID supplémentaire (SDID) ou le StitchID est inclus dans votre appel Analytics.
Validation du déploiement du code
Vous pouvez effectuer une validation à l’aide de n’importe quel type d’outil de renifleur de paquets (tel que Charles, Fiddler ou Chrome Developer Tools) en comparant les valeurs des quatre identifiants entre la requête envoyée à Adobe Advertising et la requête envoyée à Analytics, comme indiqué ci-dessous.
Comment confirmer le code avec Chrome Developer Tools validate-js-chrome
-
Ouvrez Chrome Developer Tools et cliquez sur l’onglet Réseau.
-
Chargez une page de site web contenant le JavaScript Analytics for Advertising.
-
Filtrez l’onglet Network par
lastet passez en revue deux lignes :-
La première ligne correspond à l’appel à la bibliothèque JavaScript et est intitulée
last-event-tag-latest.min.js. -
La deuxième ligne correspond à l’appel qui envoie la demande à Adobe Advertising. Elle commence comme suit :
_les_imsOrgId=[your_imsOrgId_here]&_les_url=[your_encoded_url]Si vous ne voyez pas l’appel à Adobe Advertising, il se peut que ce ne soit pas la première page vue de votre visite. À des fins de test, vous pouvez supprimer le cookie afin que l’appel suivant soit la première page vue pour la visite correspondante :
- Dans l’onglet Application , recherchez le cookie
adcloudet vérifiez qu’il contient des_les_v(dernière visite) avec une valeur deyet un horodatage UTC qui expire dans 30 minutes.- Supprimez le cookie
adcloudet actualisez la page.
- Supprimez le cookie
-
-
(Implémentations qui utilisent le code de
visitorAPI.jsExperience Cloud Identity Service) Filtrez les/b/sspour afficher l’accès Analytics. -
(Implémentations qui utilisent Experience Platform Web SDK
alloy.jscode) Filtrez sur les/interactpour vérifier que la payload de la requête envoyée à Edge Network contient desadvertisingStitchID. -
Compare the ID values between the two hits. All of the values should be in query string parameters except for the report suite ID in the Analytics hit, which is the URL path immediately after
/b/ss/.table 0-row-4 1-row-4 2-row-4 3-row-4 4-row-4 5-row-4 ID Analytics Parameter Edge Network Adobe Advertising Parameter Experience Cloud IMS Org mcorgid_les_imsOrgidSupplemental Data ID sdid _les_sdidStitch ID stitchId advertisingStitchIDunder the_adcloudpropertyAnalytics Report Suite The value after /b/ss/_les_rsidExperience Cloud Visitor ID mid _les_midIf the ID values match, then the JavaScript implementation is confirmed. Adobe Advertising sends the Analytics server any click-through or view-through tracking details if they exist.
Comment confirmer le code avec Adobe Experience Platform Debugger
-
Open the Adobe Experience Platform Debugger on your homepage.
-
Go to the Network tab.
-
In the Solutions Filter toolbar, click Adobe Advertising and Analytics.
-
In the Request URL - Hostname parameter row, locate
lasteventf-tm.everesttech.net. -
In the Request - Parameters row, audit the signals generated, similar to Step 3 in “How to Confirm the Code with Chrome Developer Tools.”
- (Implementations that use the Experience Cloud Identity Service
visitorAPI.jscode) Make sure theSdidparameter matches theSupplemental Data IDin the Adobe Analytics filter. - (Implementations that use the Experience Platform Web SDK
alloy.jscode) Make sure the value of theadvertisingStitchIDparameter matches theSdidsent to the Experience Platform Edge Network. - If the code isn’t generating, then check to make sure the Adobe Advertising cookie has been removed in the Application tab. Once it’s removed, refresh the page and repeat the process.
- (Implementations that use the Experience Cloud Identity Service