Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Tracking Dynamic URLs within Large Block of HTML from a Javascript Object

Avatar

Avatar
Validate 1
Level 1
michellec1024
Level 1

Likes

3 likes

Total Posts

9 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Give Back
Ignite 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 1
michellec1024
Level 1

Likes

3 likes

Total Posts

9 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Give Back
Ignite 1
Boost 3
Boost 1
View profile
michellec1024
Level 1

29-01-2020

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:

 

N33RdtftXm.png

 

My delivery:

 

tgZraKbH3A.png

 

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!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
wodnicki
MVP

Likes

961 likes

Total Posts

1,090 posts

Correct Reply

509 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile

Avatar
Establish
MVP
wodnicki
MVP

Likes

961 likes

Total Posts

1,090 posts

Correct Reply

509 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile
wodnicki
MVP

30-01-2020

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

Answers (1)

Answers (1)

Avatar

Avatar
Level 1
anurags71391525
Level 1

Likes

0 likes

Total Posts

6 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
anurags71391525
Level 1

Likes

0 likes

Total Posts

6 posts

Correct Reply

0 solutions
View profile
anurags71391525
Level 1

27-02-2020

@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

 

anurags71391525_0-1582873718779.png

 

How can we we define the <%@include operation?