Expand my Community achievements bar.

SOLVED

Can I unify UTM URLs in Adobe Analytics?

Avatar

Level 4

As far as I know my UTM implementation in AA is correctly done. However, if I draw a report of page name -> page URL, the UTM URLs are listed as if they are a different URLs for that page. Technically this makes sense, but this behavior is different in Google Analytics, which leads to confusion for users experienced in GA. Because in GA the URLs containing UTM tags are all unified under the page URL. Is that possible to achieve in AA too? Examples below.

 

How it works in Google Analytics:

 

User 1 accesses this URL: www.carpage.com

User 2 accesses this URL: www.carpage.com?utm_source=tag

 

Report

Page name: Car Page (2 visits)

URL: www.carpage.com (2 visits)

 

How it works in Adobe Analytics:

 

User 1 accesses this URL: www.carpage.com

User 2 accesses this URL: www.carpage.com?utm_source=tag

 

Report

Page name: Car Page (2 visits)

URL: www.carpage.com (1 visit)

URL: www.carpage.com?utm_source=tag (1 visit)

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor and Adobe Champion

This is completely up to you!

 

First off, Adobe uses "Page Name" as the primary identifier... so if your pages have been given proper names (not URL) the data will roll up to the name:

 

Now.. Since URL (or at least the URL as it appears in your reporting) is a custom field, you can control if you want to track the "Full URL" (contains UTMs) or the "URL without Parameters" (i.e. truncate all parameters from the URL value), or the "Canonical URL" (which may not even point to the same site you are on, but another site in your network where the content is shared), or any combination of the above... (I have a combination).

 

You can also create classifications on the "Full URL" to truncate out the Parameters and roll up to just the "URL without Parameters"

 

 

Now, for my UTMs, I use a concatenated version of all the parameters and track it in my standard "Campaign Codes" tracking (which is set to 1 Week Attribution), I also have eVars dedicated to each UTM separately (one for UTM Source, one for UTM Medium, etc)... each of these is set to a Visit level expiry (I can always use custom attribution on the fly to see longer if needed). So now I can see each of my UTMs in isolation.

 

Also, don't forget about your Marketing Channel rules to group your different driving factors, including UTMs into buckets.

 

 

View solution in original post

9 Replies

Avatar

Correct answer by
Community Advisor and Adobe Champion

This is completely up to you!

 

First off, Adobe uses "Page Name" as the primary identifier... so if your pages have been given proper names (not URL) the data will roll up to the name:

 

Now.. Since URL (or at least the URL as it appears in your reporting) is a custom field, you can control if you want to track the "Full URL" (contains UTMs) or the "URL without Parameters" (i.e. truncate all parameters from the URL value), or the "Canonical URL" (which may not even point to the same site you are on, but another site in your network where the content is shared), or any combination of the above... (I have a combination).

 

You can also create classifications on the "Full URL" to truncate out the Parameters and roll up to just the "URL without Parameters"

 

 

Now, for my UTMs, I use a concatenated version of all the parameters and track it in my standard "Campaign Codes" tracking (which is set to 1 Week Attribution), I also have eVars dedicated to each UTM separately (one for UTM Source, one for UTM Medium, etc)... each of these is set to a Visit level expiry (I can always use custom attribution on the fly to see longer if needed). So now I can see each of my UTMs in isolation.

 

Also, don't forget about your Marketing Channel rules to group your different driving factors, including UTMs into buckets.

 

 

Avatar

Level 4

Thanks for the response. This is all nice to hear, but the fact is documentation is lacking everywhere. I have no idea how to implement or fix based on what you are saying. A search on Google for canonical url adobe analytics, returns no documentation from Adobe. 

 

Could you please shed some light on how the following can be achieved?



Now.. Since URL (or at least the URL as it appears in your reporting) is a custom field, you can control if you want to track the "Full URL" (contains UTMs) or the "URL without Parameters" (i.e. truncate all parameters from the URL value), or the "Canonical URL" (which may not even point to the same site you are on, but another site in your network where the content is shared), or any combination of the above... (I have a combination).

 

You can also create classifications on the "Full URL" to truncate out the Parameters and roll up to just the "URL without Parameters"

 




 

Avatar

Community Advisor and Adobe Champion

There is no "default" plugin for canonical... This would just be a simple Javascript custom code, first hit for me was this stack overflow:

 

https://stackoverflow.com/questions/5980682/obtaining-canonical-url-using-javascript

 

document.querySelector("link[rel='canonical']").getAttribute("href");

^ of course, this assumes that your site is setting a proper canonical on every page.

 

On my site, to be safe, I added a fall back that if no canonical was set, then I take the current URL and truncate off the query string parameters.

 

So, assuming you want canonical, then you can use a custom code Data Element like:

var finalURL = window.document.querySelector("link[rel='canonical']").getAttribute("href");

if (!finalURL){
  var current = window.document.location.href;
 // or if you already have the current URL as a DataElement, then use var current = _satellite.getVar('data element name for url');
  finalURL = current.substring(0, current.indexOf('?'));
}

return finalURL;

 

 

If you don't want to use Canonical as your tracking, then to truncate the query params, you can just use:

 

var current = window.document.location.href;
// or if you already have the current URL as a DataElement, then use var current = _satellite.getVar('data element name for url');
var finalURL = current.substring(0, current.indexOf('?'));

return finalURL;

 

 

If you aren't comfortable with JavaScript, I don't know if your company should consider having one or more developers available to you as a resource, or to hire an implementation specialist....  At this point, being able to use resources you already have would be the cheapest option... just someone who can work with you when you need to do custom scripting and to review your work.

Avatar

Level 4

Jennifer, I really appreciate your detailed response! I will use this as basis for investigating this issue further. Many thanks

Avatar

Community Advisor and Adobe Champion

Most of the Adobe Analytics implementations have a logic to convert URL into page name by removing parameters and/or other types of transformation as necessary, now and more commonly hash for SPA. If you don't want to build your own logic, you may consider using getPageName plugin which can be very handy.

Avatar

Level 4

Where and how is this logic implemented please?

Avatar

Community Advisor and Adobe Champion

Yes, this would be an option too.. I tend not to use a lot of the Adobe plugins, but this would work... and instead of using pipe (|), like in the one example, you could use slash (/) to keep it in "url" format....

 

The problem with this plugin is that it will append "home" to the end of your root url... which then wouldn't be a valid URL.. It will also truncate out "http://" or "https://"  if you want those as part of your data.

 

i.e. https://www.domain.com/
will become: "domain.com/home"

 

using: 

s.g = getPageName("","","","/");

 

@BernardoCF do you know how and where to install Adobe plugins using Launch? (not extensions, you actually have to add these into custom code on your Adobe Analytics extension)

 

You would then remove setting the pageURL through the interface, and have this in the doPlugins code to set the value when the tracking calls are made.

Avatar

Level 4

Jennifer, 

 

Thanks. I do have access to Launch and know how to install plugins. I'm just not clear as to what transformation is being applied by 

 

s.g = getPageName("","","","/");

Would that turn www.carpage.com?utm_source=tag into www.carpage.com ?

 

Also, would this affect the processing of my utm parameters?

 

 

Avatar

Community Advisor and Adobe Champion

First off, I am not recommending the use of this plugin, but I was answering your question of how to use it (this plugin was the suggestion from leocwlau)

 

I personally don't like some of the logic that comes with this plugin, and I was just taking the sample from the documentation and changing it slightly.

 

I don't know which eVar you are using, but IF you use this plugin, instead of s.g, use s.eVarX (replace the X with the correct eVar number)

 

Now, your value:

https://www.domain.com/?utm_source=tag 

will be turned into

domain.com/home

 

This is part of the plugin, and one of the reasons I would advise against using this plugin. Since "/home" is not a valid URL in your system... but that is how it will be recorded when using this plugin,

 

It's "easy".. but it also results in changing the value of your root page to something invalid (since this plugin is supposed to be used to create a page name from your URL, where it technically replaces the "/" in the url with "|" or something of your choice... in the sample code, I am replacing "/" with "/" (so basically, no replacement) and letting it do the rest of the work to remove the query parameters... but there is nothing that can be done to stop this plugin from creating the "home" node on your root.

 

Since you will be populating this value into it's own eVar, there will be no impact on your UTM processing, which will be done against the actual "g" (or pageUrl) parameter... the eVar will be used for your reporting.

 

 

I provided a simple code solution above that gives you full control over what happens... no injected "home" creating invalid URLs, you can maintain the "http" or "https" of the url, you can maintain "www" of your URL (FYI, since I do not use this plugin I do not know how it will treat subdomains like https://special.domain.com/ - It will likely drop "special" like it drops www, and it will definitely add "home" to the end since this is a root page), but my code will definitely maintain the subdomain...  Removing the comment that I added above, mine is 3 lines of code (which is more efficient that the plugin route). However, you can use whichever solution you choose... I will help you with whichever option.