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

Web analytics Account configuration

Avatar

Avatar
Boost 5
Level 2
ramprakasht3196
Level 2

Likes

9 likes

Total Posts

43 posts

Correct Reply

0 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Boost 5
Level 2
ramprakasht3196
Level 2

Likes

9 likes

Total Posts

43 posts

Correct Reply

0 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
ramprakasht3196
Level 2

21-04-2021

Hi,

 

We are using web analytics account to add UTM tags. In Email delivery we are using newsletter defined in the publication template. In template there are multiple buttons and URL are configured. Our requirement is too add utm tags with custom attribute. I have added below code in the Web analytics external Account. When I click the link or button present  in the email I can see the UTM tags in the URL.

 

 

<%@ include option='NmsTracking_ClickFormula' %><% // Parameters expected by Adobe Analytics Data Connector
var pattern = new RegExp("(www)", 'i')
var mtype= message.delivery.messageType;
if( $(urlstring).match(pattern) && delivery.FCP == false && mtype==0)
{
%>&utm_source=abc&utm_medium=email&utm_campaign=<%= message.delivery.customAttribute %><% }
else
{%>
&utm_source=abc&utm_medium=sms&utm_campaign=<%= message.delivery.customAttribute %>
<% }%>

 

The new requirement is, if the customer clicks button in the email then UTM content should display  as button. If Link is clicked then UTM content should be displayed as link in the URL.

Example for

button: www.google.se?utm_source=abc&utm_medium=email&utm_campaign=Abc&utm_content=button

Link: www.google.se?utm_source=abc&utm_medium=email&utm_campaign=Abc&utm_content=link

Could any one please guide me how to achieve this.

 

Thanks in advance.

Ram.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 5
Employee
denisb91363072
Employee

Likes

8 likes

Total Posts

28 posts

Correct Reply

6 solutions
Top badges earned
Boost 5
Affirm 5
Boost 3
Boost 1
Affirm 3
View profile

Avatar
Boost 5
Employee
denisb91363072
Employee

Likes

8 likes

Total Posts

28 posts

Correct Reply

6 solutions
Top badges earned
Boost 5
Affirm 5
Boost 3
Boost 1
Affirm 3
View profile
denisb91363072
Employee

29-04-2021

Hi Ram,

There are 2 topics on your context

 

  1. The URL doesn't know the context is it HREF in: Button or Link, what you would do if to add a label for all the tracked link via the _label element and you could introduce a naming convention (btn, lnk, img). The label is what is seen in the URL & Clickstream reports and is Adobe internal only.
  2. The 2nd part is the trickiest one as in the TrackingFormula associated to the Web Analytics external account, you would have to loop through the list of tracked URL, matching to the one current prepared, look at whether it contains one of the naming convention and set the content_tum accordingly. The code would look like as below

<%@ include option='NmsTracking_ClickFormula' %><% var pattern = new RegExp("(^(http|https)://(.*))", 'i'); if ($(urlstring).match(pattern)) { var contentType; for (var x=0; x<delivery.content.html.urlConfig.url.length; x++) { if (delivery.content.html.urlConfig.url[x].tagId == "$(urlId)" && delivery.content.html.urlConfig.url[x].label > "") { contentType =delivery.content.html.urlConfig.url[x].label; }} contentType = contentType.replace(/\s/g,"_"); %>&utm_content=<%= escapeUrl(contentType) %>&cid=<%= message.delivery.internalName %>&bid=<%= message.id.toString().toLowerCase() %><% } %>

 

The above code loops through the list to tracked URL and will put the delivery label in the utm_content parameter, you would have to rework it that the label of the URL is tested to include btn, img or lnk as part of it to set the utm_content accordingly.

Try the above to ensure it compiles and works and then adapt to your need.

 

All I can think of and I hope it helps.

 

Thanks,

 

Denis

Answers (0)