As per our understanding there are 2 parts of your question ,1st being why the Event Based Rule you created for download link is not firing and the 2nd being How to basically create an event based data element such that the data element captures the processed href value of the download link and then can be further used in tracking codes.
Answer to 1st part of your question:
Generally if an event based rule doesn't fire on a click , there is likely an issue with the selector or condition of the rule.Locate the element on your site where the desired event action occurs, right click and select Inspect element. Inspect the highlighted script in the box that opens and ensure you are targeting the correct element. Please let us know if you have any questions on this .
Answer to 2nd part of your question:
To define a data element on the fly and then use it in the interface for an event based rule, we can dynamically capture the value of the event, and can set it when defining the criteria for an event based rule, within the custom code block in rule conditions using below code:
// This data element will now be available like any other within the interface using %Download_Link_Name% Additional Points:
setVar saves the data element on a page level scope – this is okay since you’ll typically only be manually setting these variables when you are referencing elements with $(this).
You can also use %% substitutions for these data elements within the UI. For the example above, we could have referenced the data element via %link ID%.
When you manually override a data element that exists and has a scope, it retains the scope of the element.
Please feel free to reach out to us in case of further queries.
Yes, that box is checked and the file extension is in the list. The download link tracking is working. My question was about how to intercept clicks on download links by DTM Event Based Rule for extra manipulation. I cannot understand why the rule as shown in the attached screenshots is not intercepting clicks on the links I mentioned in the first message. As a result Adobe Analytics request contains the default values as shown below:
I was wondering if you could help me with an explanation of how to build an event based rule where I can add an extra JS code for href value processing? E.g. instead of capturing full URL in the default Download link report in Adobe Analytics, I would like to capture the file name only and to introduce a Data Element with it so that the file name can be passed to all other tracking codes added in DTM.
Can you please recheck "Link Tracking Tab" under Adobe Analytics Tool configuration and let us know whether the track download links checkbox is "checked" or not. As it is required to check the "track download links" option to enable the tracking of download links . Also , it is required to add the file download extension (e.g. .zip , .pdf etc) to Download Extensions . Please see the attached snapshot for more details.
If the problem still persists , you can alternatively create an event based rule for tracking the download link . Please see the following for more more information on creating event based rule.