Hi,
I am pulling in large block of HTML (abcMeta.html) from a Javascript object. There are URLs within this block of html that I need tracking to be enabled for.
UPDATE: abcMeta.html is a variable with a long string of text (it's not a file)
Example of abcMeta.html:
<td style="padding-top:0;"><a href="https://www.google.com">Google</a></td>
How I am pulling in data from abcMeta:
My delivery:
What is the best way to enable tracking for all URLs within the dynamic block of HTML?
I saw Adobe's documentation on how to track personalized URLs but those solutions seem to work only for individual URLs and not multiple URLs mixed in with the rest of the HTML.
Thanks!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
Use an @include directive for the file:
<%@ include file='file:///tmp/abcMeta.html' %>
If your url's are in a loop or similar, unroll it so the parser can see, with the protocol outside the js:
<% var urls = [['aol.com', 'AOL']]; %>
<% if (urls[0]) %><a href="https://<%= urls[0][0] %>"><%= urls[0][1] %></a>
<% if (urls[1]) %><a href="https://<%= urls[1][0] %>"><%= urls[1][1] %></a>
Thanks,
-Jon
Views
Replies
Total Likes
Hi,
Use an @include directive for the file:
<%@ include file='file:///tmp/abcMeta.html' %>
If your url's are in a loop or similar, unroll it so the parser can see, with the protocol outside the js:
<% var urls = [['aol.com', 'AOL']]; %>
<% if (urls[0]) %><a href="https://<%= urls[0][0] %>"><%= urls[0][1] %></a>
<% if (urls[1]) %><a href="https://<%= urls[1][0] %>"><%= urls[1][1] %></a>
Thanks,
-Jon
Views
Replies
Total Likes
Thanks Jon.
abdMeta.html is not a file, it's a variable. Would the <%@ include still work if it's a variable?
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
The way tracking works is if you want to use the ootb system, the content parser which populates nms:trackingUrl and the tracking metadata xml files has to be able to parse the urls, specifically the static text '<a href="protocol://'. OOTB solutions will be constrained to that, such as the unroll answer above. DIY has no constraints, but then you're diy'ing the whole hot glue flowerpot.
Views
Replies
Total Likes
Views
Replies
Total Likes
@Jonathon_wodnicki Quick question here:-
What If I need to track links present in variable that I have declared in delivery properties as below. My content comes via the below defined variable
How can we we define the <%@include operation?
Views
Replies
Total Likes