JavaScript code for Analytics for Advertising

仅使用Advertising DSP的广告商

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.

NOTE
The Adobe Advertising JavaScript tracking logic occurs on the Adobe side and thus has virtually no impact to the page load time.
In contrast, the logic for the DCM data connector to Analytics (using Google Campaign Manager 360) for Advertising DSP occurs on the client side. Client-side stitching slows down the page load and increases the risk of data loss. This occurs because the Analytics JavaScript must ping DoubleClick and wait for DoubleClick to pass back the last click/impression data to Analytics. When your DSP team sets up the DCM data connector, you must specify how long you're willing to delay the page.

Deploying the JavaScript code

The JavaScript library consists of two lines that allow Analytics and Adobe Advertising to communicate with each other. 如果Analytics for Advertising集成已在Adobe Advertising实施期间完成,则您应该已经收到此代码,其中包含有关如何部署此代码的说明。

代码

使用Experience Cloud Identity Service visitorAPI.js代码的实施

<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>

使用Experience Platform Web SDK 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>

代码放置位置

Analytics for Advertising JavaScript函数必须在Experience Cloud ID服务之后、Analytics App Measurement代码之前。 这可以确保在您的Analytics调用中包含补充ID (SDID)或StitchID

代码位置

验证代码部署

您可以使用任何数据包探查器类型的工具(如Charles、Fiddler或Chrome Developer Tools)执行验证,方法是比较发往Adobe Advertising的请求和发往Analytics的请求之间的四个ID的值,如下所述。

如何使用Chrome Developer Tools确认代码 validate-js-chrome

  1. 打开Chrome Developer Tools并单击​ 网络 ​选项卡。

  2. 加载包含Analytics for Advertising JavaScript的网站页面。

  3. last筛选Network选项卡并查看两行:

    在上次 筛选

    • 第一行是对JavaScript库的调用,标题为last-event-tag-latest.min.js

    • 第二行是将请求发送到Adobe Advertising的调用。 其开头如下: _les_imsOrgId=[your_imsOrgId_here]&_les_url=[your_encoded_url]

      如果您没有看到对Adobe Advertising的调用,则该调用可能不是您访问的第一个页面查看。 出于测试目的,您可以删除Cookie,以便下次调用是相应访问的第一个页面查看:

    1. 在“应用程序”选项卡上,找到adcloud Cookie,并验证Cookie是否包含值为y_les_v(上次访问)以及30分钟后过期的UTC纪元时间戳。
      1. 删除adcloud Cookie并刷新页面。
  4. (使用Experience Cloud Identity服务visitorAPI.js代码的实施)筛选/b/ss以查看Analytics点击。

    在/b/ss 上筛选

  5. (使用Experience Platform Web SDK alloy.js代码的实施)在/interact上筛选以验证发送到Edge Network的请求有效负载是否包含advertisingStitchID

    在/interact 上筛选

  6. 比较两次点击之间的ID值。 所有值都应位于查询字符串参数中,但Analytics点击中的报表包ID(紧接/b/ss/之后的URL路径)除外。

    table 0-row-4 1-row-4 2-row-4 3-row-4 4-row-4 5-row-4
    ID Analytics参数 Edge Network Adobe Advertising参数
    Experience Cloud IMS组织 mcorgid _les_imsOrgid
    补充数据ID sdid _les_sdid
    拼接ID stitchId _adcloud属性下的advertisingStitchID
    Analytics报表包 /b/ss/之后的值 _les_rsid
    Experience Cloud访客ID mid _les_mid

    如果ID值匹配,则会确认JavaScript实施。 Adobe Advertising向Analytics服务器发送任何点进或浏览跟踪详细信息(如果存在)。

如何使用Adobe Experience Platform Debugger确认代码

  1. 在主页中打开该 Adobe Experience Platform Debugger

  2. 转到Network选项卡。

  3. 在Solutions Filter工具栏中,单击Adobe Advertising和Analytics。

  4. 在Request URL - Hostname参数行中,找到lasteventf-tm.everesttech.net

  5. 在Request - Parameters行中,审核生成的信号,类似于“如何使用 Chrome Developer Tools确认代码”中的步骤3。

    • (使用Experience Cloud Identity Service visitorAPI.js代码的实施)确保Sdid参数与Adobe Analytics筛选器中的Supplemental Data ID匹配。
    • (使用Experience Platform Web SDK alloy.js代码的实施)确保advertisingStitchID参数的值与发送到Experience Platform Edge Network的Sdid匹配。
    • 如果代码未生成,则检查以确保已在Application选项卡中删除Adobe Advertising Cookie。 删除页面后,请刷新页面并重复此过程。

    在Platform Cloud Debugger 中审核Analytics for Advertising个JavaScript代码

recommendation-more-help
advertising-help-integrations