Home AppMeasurement Web SDK · Migration Guide Created by Amit G Dusane

MigrationKnowledge Base › Plugin cookbook

Reference

Plugin cookbook

The old doPlugins was your "last call", the function that ran in the split second before every hit, your final chance to set or tweak variables. The Web SDK has no equivalent function, so that logic moves to two homes[16][17]: the onBeforeEventSend callback (a global last-call that mutates the payload before it sends)[15] and the Common Web SDK Plugins extension, which ports the most-used plugins as native data elements[18].

[19][20]
getQueryParamClean, URL Parameter data element
getValOnceClean, Common Web SDK Plugins data element
getPreviousValueClean, plugins data element (on SPAs, verify it reads previous, not current)
getTimePartingClean, plugins data element, or use Workspace time dimensions
apl (append-to-list)Manual, no native element; rebuild in onBeforeEventSend
getPercentPageViewedAwkward, scroll/unload timing; reimplement and validate carefully
crossVisitParticipationReconsider, often better served by Attribution IQ than re-porting

For your migration: the Common Web SDK Plugins are Adobe-Consulting courtesy code, not Customer Care–supported, and several aren't available for raw-library use. For the awkward ones, first ask whether a Workspace feature makes the plugin unnecessary at all.

Full detail, the complete reference

doPlugins had no successor function; it has two

doPlugins was your "last call": the function that ran in the split second before every hit, your final chance to set or tweak variables. The Web SDK has no single equivalent, so that logic moves to two homes used together. The first is onBeforeEventSend, a callback registered on the extension (Configure → Data Collection → "on before event send callback code")[15] that runs before every event and receives the payload to mutate; return false aborts the send. The second is the Common Web SDK Plugins extension[18], which ports the most-used plugins as native data elements.

Worked: campaign tracking with de-duplication

Old doPlugins grabbed a campaign code, de-duped it for the session, and counted it once:

s.campaign = s.Util.getQueryParam("cid");
s.campaign = s.getValOnce(s.campaign, "s_camp", 0);
if (s.campaign) { s.events = s.apl(s.events, "event1", ",", 2); }

The Web SDK rebuild is three named pieces, no doPlugins: a URL Parameter data element for cid; a getValOnce data element (from the plugins extension) wrapping it[19]; mapped into xdm.marketing.trackingCode. The apl step has no native element, so it goes in onBeforeEventSend:

function (content) {
  var tc = content.xdm && content.xdm.marketing && content.xdm.marketing.trackingCode;
  if (tc) {
    content.xdm._experience = content.xdm._experience || {};
    content.xdm._experience.analytics = content.xdm._experience.analytics || {};
    (content.xdm._experience.analytics.event1to100 =
       content.xdm._experience.analytics.event1to100 || {}).event1 = { value: 1 };
  }
}

The honest cookbook

getQueryParamClean, URL Parameter data element
getValOnceClean, plugins data element
getPreviousValueClean, but on SPAs verify it reads previous, not current
getTimePartingClean, or use Workspace time dimensions instead
aplManual, rebuild in onBeforeEventSend (no native element)
getPercentPageViewedAwkward, scroll/unload timing; reimplement and validate carefully
crossVisitParticipationReconsider, often better served by Attribution IQ
Caveat

The Common Web SDK Plugins are Adobe-Consulting courtesy code, not Customer Care–supported, and several aren't available for raw-library use. For the awkward ones, first ask whether a Workspace feature removes the need entirely.

doPluginsthe old last callonBeforeEventSendglobal last-call · mutate the payload (e.g. rebuild apl)Common Web SDK Pluginsnative data elements · getValOnce, getPreviousValue...the extension is Adobe-Consulting courtesy · not Customer Care supported
doPlugins has no single successor; its work splits in two: a global onBeforeEventSend callback for custom logic, and the plugins extension for the common ones as data elements.