If your implementation still uses H Code, Adobe highly recommends migrating to the latest version of AppMeasurement. Implementing Analytics through tags in Adobe Experience Platform is recommended, however an updated JavaScript implementation can be used.
The following notable changes are present in AppMeasurement when compared to H Code:
<head>
tag.dynamicAccountSelection
, dynamicAccountMatch
, and dynamicAccountList
).The following steps outline a typical migration workflow.
AppMeasurement.js
file, along with Media and Integrate modules.s_code.js
customizations to AppMeasurement.js
: Move all the code before the DO NOT ALTER ANYTHING BELOW THIS LINE
section in s_code.js
to the beginning of AppMeasurement.js
.s_code.js
file. This step includes the Media and Integrate modules.AppMeasurement.js
file to your web server.AppMeasurement.js
: Make sure all pages reference AppMeasurement.js
instead of s_code.js
.A typical AppMeasurement.js
file. Make sure that configuration variables are set above the doPlugins
function.
// Initialize AppMeasurement
var s = s_gi("examplersid");
/******** VISITOR ID SERVICE CONFIG - REQUIRES VisitorAPI.js ********/;
s.visitor=Visitor.getInstance("INSERT-MCORG-ID-HERE");
/************************** CONFIG SECTION **************************/;
/* You may add or alter any code config here. */
s.trackDownloadLinks = true;
s.trackExternalLinks = true;
s.trackInlineStats = true;
s.linkDownloadFileTypes = "exe,zip,wav,mp3,mov,mpg,avi,wmv,pdf,doc,docx,xls,xlsx,ppt,pptx";
s.linkInternalFilters = "javascript:,example.com";
s.usePlugins = true;
function s_doPlugins(s) {
// Use implementation plug-ins that are defined below in this section
}
s.doPlugins = s_doPlugins;
/* WARNING: Changing any of the below variables will cause drastic
changes to how your visitor data is collected. Changes should only be
made when instructed to do so by your Adobe Account Team.*/
s.trackingServer="example.data.adobedc.net";
/************************** PLUGINS SECTION *************************/
// Copy and paste implementation plug-ins here. Plug-ins can then be used in the s_doPlugins(s) function above
/****************************** MODULES *****************************/
// Copy and paste implementation modules (Media, Integrate) here.
/* ============== DO NOT ALTER ANYTHING BELOW THIS LINE ! =============== */
Typical code that loads on each page.
<script src="AppMeasurement.js"></script>
<script language="JavaScript" type="text/javascript">
s.pageName = "Example page name";
s.eVar1 = "Example eVar value";
s.events = "event1";
s.t();
</script>
Make sure that you have also included a reference to AppMeasurement.js
and VisitorAPI.js
on each page. See JavaScript Implementation for more information.