Activity Map Destination

An enhancement to Adobe Analytics' Activity Map plugin, which allows you to see where users are navigating to on your site.

Getting Started

In addition to the default Activity Map variables available in Adobe Analytics, it is possible to capture the destination page of a link called "Activity Map Destination". This dimension has two primary benefits in reporting:

  1. Analysts are able to understand where their links lead (i.e., their landing pages) to more fully understand the click journey.

  2. Analysts are able to differentiate similar links. i.e., those with the same page, region, and name. For example, multiple links that say 'Learn More' on the same page.

Installation

Installation is simple, with only needing to add an extra plugin to your App Measurement library. The following steps should be taken to properly install the plugin:

  1. Install the code block below after the Activity Map module.

    1. If you are using Adobe Tags and are using an Adobe-managed library, you can add this within the "Configure Tracker Using Custom Code" code editor. Be sure the "Use Activity Map" checkbox is checked.

    2. If you are managing the library custom code, or if you are not using Adobe Tags, then you can find the Activity Map module by searching for function AppMeasurement_Module_ActivityMap within your library code.

  2. If desired, add a configuration object to your library. See more on configuration.

  3. Test to ensure that the code is implemented properly and there aren't any conflicts or issues.

  4. Finally, configure your Processing Rules to collect the Activity Map Destination into your new dimension(s)!

/**
 * Start Activity Map Destination Addition 2023.03.13
  
 * This plugin allows for you to track the destination (URL) of the link clicked within ActivityMap. Data is sent to the context data a.activitymap.destination, and can then
 * be picked up via a processing rule. 
 * 
 * Provided by Acronym, a Performance Marketing Agency
 * https://www.acronym.com/
 */
(()=>{const t="AppMeasurement_Module_ActivityMap",i=(...t)=>{console.log("Activity Map Destination",t)};if("function"!=typeof window[t])return void i(t+" has not loaded.");const n=window.s_c_il.filter((i=>i instanceof window[t]));n||i("Activity Map Module instance not found."),n.forEach((t=>{let n=t._g,a=t.s,o=a.linkDestinationOptions||{};t._g=function(){n.apply(t,arguments);try{if(a.contextData["a.activitymap.link"]){let t="";if(a.linkObject&&"string"==typeof a.linkObject.href&&a.linkObject.href){let i=new URL(a.linkObject.href);if(t=(/^http/i.test(i.protocol)?"":i.protocol)+i.hostname+i.pathname,!1===o.trailingSlash&&(t=t.replace(/\/$/,"")),o.showParams){let n=[];o.showParams.forEach((function(t){n.push(t+"="+i.searchParams.get(t))})),n.length&&(t+="?"+n.join("&"))}o.showHash&&(t+=i.hash),/^javascript:/i.test(t)&&(t="")}t&&""!==t||(t="no destination"),a.contextData["a.activitymap.destination"]=t}}catch(t){i(t)}}}))})();
/* End Activity Map Destination Addition */

Plugin Configuration

Configuration is completely optional and Acronym has set defaults that have made sense for a majority of our Clients. These values should be configured in an object called s.linkDestinationOptions, which should be set within your library code. It does not need to be after the Activity Map Module or Activity Map Destination plugin code. Acronym recommends setting this with the other link options (e.g., s.linkInternalFilters or s.linkDownloadFileTypes).

The following options are available to configure:

Keep Trailing Slashes

This option allows analysts to keep or remove the trailing slash from URL paths.

Property Name: trailingSlash

Available Values: A boolean value: true to keep trailing slashes, false to remove them if they exist.

Default Value: true (keep slashes)

URL Parameter Allow List

This option allows analysts to keep or remove the trailing slash from URL paths.

Property Name: showParams

Available Values: An array of URL parameter keys that should be kept. E.g., ["cid", "icid"] would keep only cid and icid, and would remove all other URL parameters from the destination URL.

Default Value: [](no parameters kept)

Keep URL Hash

This option allows analysts to keep or remove the hash from the URL.

Property Name: showHash

Available Values: A boolean value: true to keep the URL hash, false to remove if it exists.

Default Value: false(remove URL hash)

Example Configuration

Below is an example of a configuration that keeps the URL hash, removes trailing slashes from the URL path, and includes cid, icid, productId URL parameters.

s.linkDestinationOptions = {
    trailingSlash: false,
    showParams: ['cid', 'icid', 'productId'],
    showHash: true
};

Testing & QA

Once implemented, you can test if the plugin is working by going to a page where the plugin is installed and clicking a link. Using a debugger such as Adobe's Experience Platform Debugger or Omnibug, look to see if the a.activitymap.destination key/value pair exists within the Context Data.

Enabling Processing Rules

The final step is to create and enable processing rules that copy the destination values from context data into your props or eVars. Acronym generally recommends copying all the Activity Map dimensions into custom props or eVars so you can then use Classifications on them.

To set these, create a new rule that Overwrites value of [your custom dimension(s)] with a value from any of the following:

VariableDescription

a.activitymap.page

The page where the link was clicked

a.activitymap.link

The text of the link clicked

a.activitymap.region

Where on the page the link was clicked

a.activitymap.destination

The URL of the link that was clicked (what this plugin added!)

You can optionally add a condition that verifies that the value is set before overwriting the value, though in almost all cases it should not be necessary.

Now you should start to see data flowing into your reports!

Need Help With Your Adobe Products?

At Acronym, we specialize in performance marketing, helping our clients achieve their goals. Whether you're a mid-range business looking to increase efficiency, or a larger enterprise striving for something more, we bring our expertise and innovation to each project.

With offices in New York City, Toronto, Paris, Berlin and Singapore, our team of over 200 marketing, analytics, and technology professionals deliver integrated digital strategies that capture attention and drive engagement across all touchpoints. We have unique expertise in e-commerce/retail, travel, software/technology, and financial services - giving us the tools to tackle your most complex challenges.

Let Acronym put our experience to work for you - as we create an integrated digital strategy that delivers results and exceeds expectations! For more information, contact us at newbusiness@acronym.com

Please note that we do not offer public support for the Activity Map Destination plugin.

Last updated