Hi team - We have created a custom object and we are adding the content in Custom object and then populating/printing it in the email via velocity script, we have modules like image, title, text section and CTA which are 20 in number so that the script runs in loop to populate the publication content, we have created independent variables for the 20 publications so that our links get tracked in Marketo, we are able to track but the Marketo report shows them tracked twice or thrice, is there a solution on how to fi that, this is really urgent?
@GXUnite , we'll need to see your velocity code to be able to help. I have a hunch, but without code that hunch is meaningless.
Here is how to post code: https://nation.marketo.com/t5/product-blogs/posting-code-in-discussions/ba-p/341001/highlight/true
Thanks, sharing the script below, we have around 20 publication sections so each section shares the same URL on Image, teaser, title and Read More CTA. I was able to create a script so that the URLs are getting tracked but Marketo is tracking them as thrice for the first click after receiving the email and after the second click, it counts as 1 click.
Script shared below is for one publication only, the same code repeats 20 times.
#set($eAlertsList = ${eAlertSubscription_cList})
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align: top; width: 100%; mso-line-height-rule: exactly; line-height: 16px; border-collapse:collapse;line-height:100%;">
<tbody>
#foreach($eAlertSubscription_c in $eAlertsList)
#if($foreach.index < 20)
#set($index = $foreach.index + 1)
#set($rawPermalink = $eAlertSubscription_c.pERMALINK.trim())
#set($cleanPermalink = $rawPermalink.replace("https://", "").replace("http://", ""))
#set($permalinkURL = "$cleanPermalink")
#if($eAlertSubscription_c.rECTANGLE_IMAGE)
#set($imageURL = $eAlertSubscription_c.rECTANGLE_IMAGE)
#else
#set($imageURL = "https:/imageurlexample.com")
#end
#evaluate("${esc.h}set(${esc.d}permalinkURL_${index} = ${esc.d}permalinkURL)")
#evaluate("${esc.h}set(${esc.d}imageURL_${index} = ${esc.d}imageURL)")
#evaluate("${esc.h}set(${esc.d}title_${index} = ${esc.d}eAlertSubscription_c.tITLE)")
#evaluate("${esc.h}set(${esc.d}teaser_${index} = ${esc.d}eAlertSubscription_c.tEASER)")
#end
#end
#if($permalinkURL_1)
<tr>
<td align="left" style="font-size: 0; padding: 0; word-break: break-word; padding-top: 20px; padding-bottom: 20px;">
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="min-width: 100%; mso-line-height-rule: exactly; line-height: 16px;">
<tbody>
<tr>
<th class="full-width-table-cell-mobile" align="left" style="width:180px;vertical-align: top;">
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="min-width: 100%; direction: ltr; mso-line-height-rule: exactly; line-height: 16px;">
<tbody>
<tr>
<td>
<a href="http://${permalinkURL_1}?utm_campaign=none&utm_unique=one&utm_description=ealert&utm_topic=none&utm_geo=Global&utm_medium=email&utm_source=esp&utm_content=${lead.utmcontent}" target="_blank">
<div class="larger-img-mobile">
<img src="${imageURL_1}" width="180" height="101" style="display: block; vertical-align: center; text-align: top; width: 180px; height: 101px; object-fit: cover; object-position: top;" align="top" border="0">
</div>
</a>
</td>
</tr>
</tbody>
</table>
</th>
<th class="full-width-table-cell-mobile" style="width:20px;height:20px;line-height:20px;"> </th>
<!-- Title and Teaser section -->
<th align="left" class="full-width-table-cell-mobile padding-0-mobile" style="vertical-align: top;padding-right:10px">
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="mso-line-height-rule: exactly; line-height: 16px; min-width: 100%; direction: ltr; mso-line-height-rule: exactly; line-height: 16px;">
<tbody>
<tr>
<td align="left" style="font-size: 0; padding: 0; word-break: break-word; padding-bottom: 20px;">
<div style="font-size: 16px; line-height: 20px; font-weight: 700; color: #000000; font-family: 'Trebuchet MS', Roboto, Arial, sans-serif;">
<a href="http://${permalinkURL_1}?utm_campaign=none&utm_unique=two&utm_description=ealert&utm_topic=none&utm_geo=Global&utm_medium=email&utm_source=esp&utm_content=${lead.utmcontent}" target="_blank" style="text-decoration: underline; color: #000000;">${title_1}</a>
</div>
</td>
</tr>
#if($teaser_1)
<tr>
<td align="left" style="font-size: 0; padding: 0; word-break: break-word; padding-bottom: 20px;">
<div style="font-size: 16px; line-height: 20px; font-weight: 400; color: #000000; font-family: Georgia, Arial, sans-serif;">
<a href="http://${permalinkURL_1}?utm_campaign=none&utm_unique=three&utm_description=ealert&utm_topic=none&utm_geo=Global&utm_medium=email&utm_source=esp&utm_content=${lead.utmcontent}" target="_blank" style="text-decoration: none; color: #000000;">${teaser_1}</a>
</div>
</td>
</tr>
#end
<tr>
<td align="left" style="font-size: 0; padding: 0; word-break: break-word;">
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="mso-line-height-rule: exactly; line-height: 16px; border-collapse: separate; line-height: 100%;">
<tbody>
<tr>
<td align="center" role="presentation" style="border-radius: 2px; cursor: auto; mso-padding-alt: 8px 12px; background-color:transparent;border:2px solid #197A56; color:#197A56; text-decoration:none;" valign="middle">
<a href="http://${permalinkURL_1}?utm_campaign=none&utm_unique=four&utm_description=ealert&utm_topic=none&utm_geo=Global&utm_medium=email&utm_source=esp&utm_content=${lead.utmcontent}" style="display:inline-block;font-family:'Trebuchet MS', Roboto, Arial, sans-serif;letter-spacing: 0.111px;font-size:14px;font-weight:400;line-height:14px;margin:0;text-decoration:none;text-transform:uppercase;padding:8px 10px;mso-padding-alt:0px;border-radius:2px; background-color:transparent;border:2px solid #197A56; color:#197A56; text-decoration:none;border:none;" target="_blank">Read More</a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</th>
</tr>
</tbody>
</table>
</td>
</tr>
#end
@GXUnite ,
I edited your post to make the code readable. I'd also (in my original reply) provided info on how to properly paste code. Can you make sure and follow the instructions as it makes it much easier to help you when the code is more readable.
When you say the same code repeats 20 times, do you mean it LOOPS 20 times or the output stage is REPEATED 20 times?
Cheers
Jo
Thanks @Jo_Pitts1
Yes, it loops 20 times with independent variables, thanks!