I'm trying to implement Adobe Analytics via DTM.
Regular "s.t()" functions well, but for some reason trackDownloadLinks and trackExternalLinks don't fire.
My settings are bellow.
Load Adobe Analytics page code at : Page Bottom (tried both Page Top and Page Bottom)
s_code : Managed (tried both Legacy code and AppMeasurement code)
Link Tracking settings
Track download links : checked
Track outbound links : checked
* I also tried to configure those settings on the managed s_code, but it didn't work too.
Are there any fault on my settings?
I will appreciate any help.
These should work just fine out of the box. Check your s_code to see if you have any unique configurations for these, such as using the s.linkHandler, s.downloadLinkHandler, or s.exitLinkHandler plug-ins. If you are, remove them just in case. If you have the link settings configured in the s_code, it will trump any settings you have in DTM. Otherwise DTM's settings will be applied. If you still have issues try getting rid of your current s_code and instead pasting a brand new copy of the AppMeasurement code without adding any additional settings. This includes creating the s object in the code. This will allow DTM to do everything for you. It should work. Then you can add your customized code and if it doesn't work you'll have to troubleshoot to see what code is causing the problem.
Download and Exit link tracking works Automatically by the out-of-box s_code. Try to eliminate the issue between DTM of s_code config as suggested in the previous comment. Also, make sure that the domain name (exit link domain) is not included in s.linkInternalFilter in your s_code file hosted on DTM.
Yes, although you may have declared the global object as "smetrics", you will still want to use "s" when referring to any custom code block. This applies to the customize code section in the Adobe Analytics tool settings, as well as the customize code section for Adobe Analytics in any rules. You most likely will never refer to Adobe Analytics code outside of these sections, but if you do refer to it from a 3rd party tag, you will need to make sure it is "smetrics". The reason is that in these custom code sections, DTM is actually creating a function, and the "s" object you defined (in this case "smetrics") will be passed as "s" in the parameter of this function. For example, when the custom code gets created, it will look something like this (although this is very simplified):
Then when the custom code section gets called, it will be called like this:
In the custom function, it passes your "s" object, which the function has defined as "s". That way you can update any settings, regardless of what you are using. The key is that you always refer to it as s. Also, never do something like this in the code, although there might be others that say to do this, even some Adobe documentation or videos.
var s = window.smetrics;
Thanks for the update Adam, looks like Adobe is listening to their Audience and acting very swiftly. In fact, I did mention in few of my posts in the public domain and wished to have such option in DTM which can let you execute Before/After UI Settings in DTM. Glad that we got one. I will test it and post my review comments in the forum soon, for the benefit of other DTM users.
I'm concerned after read your post, I've a couple of question about your words:
- On "Costomize Page Code" section, must use a "s" object instead "smetrics" (my object declared in DTM)?
- On Adobe Analytics Rules, If I use custom code, should I use a "s" object also? Same for Data Elements?
Many thanks for your help,
Glad that helped. However, there is a recent update that came out in DTM that will allow you to apply certain configurations before or after the DTM configurations. These can be found at the bottom of the Adobe Analytics tool configuration in the section titled "Customize Page Code". You'll see there are now 2 options:
Here you can see that you can specify if the UI or the code is going to trump the other. Just note that you must put the code in this section, and not in your s_code file. When you enter the code in this section, always use "s" as the object, even if you have set it up to be something else. DTM will always refer to "s" in any custom code. It refers to it locally, not globally, so it is safe to do so.