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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Enable tracking for URL's passed as targetData

dboat
Level 2
Level 2

Hello,

When URL's are passed as targetData from the workflow to the content form they are not marked for personalization and no tracking information is added. Is there a way to ensure they are detected and the proper tracking information is appended?

Thanks.

0 Replies
Amit_Kumar
Community Advisor
Community Advisor

Hi,

use this documentation for your reference and follow the instruction given there then you will be able to track them.

How to track personalized links in emails

Feel free to reach out to us if you need more information.

Regards,

Amit

dboat
Level 2
Level 2

Hi Amit,

I did read this documentation and at first it seemed like it would work however I am not understanding the implementation. The URL is passed from the workflow (e.g., targetData.myUrl has a value of 'https://www.mywebsite.com/') and can be unique per recipient however the detection of tracking links happens before the personalization process so these URL's are not appended with the respective tracking information.

I wanted to preprocess this targetData so that the tracking analysis would see these links, however the object isn't available in the @value instructions.

Amit_Kumar
Community Advisor
Community Advisor

Hi,

what you are doing falls under dynamic vale, so you have two options:

Option 1:  Use <a href="http://<%=targetData.myURL%>"> myURLwill have value without the protocol part, but this is not recommended.

Option 2: Use <%@ value

This instruction gives access to parameters of the delivery that is constant for all recipients.

Syntax:

<%@ value object="myObject" xpath="@myField" index="1" %>

Where:

  • "object": name of the object (example: delivery, provider, and so on).
  • "XPath": XPath of the field.
  • "index" (optional): if "object" is an array (for extra script objects), item index in the array (Starts at 0).

The object can be:

  • "delivery": for the current delivery (see details and restrictions in the subsection below).
  • "provider": for the current delivery provider/routing (nms:externalAccount).
  • An additional script object: if an object is loaded in the context through: Properties > Personalization > Add objects in the execution context.
  • Item of the foreach loop: see Foreach section below.

"delivery" object: For email personalization, the delivery object is accessible in two ways:

  • In JavaScript. For example: <%= delivery.myField %>. In the JavaScript object delivery custom fields are not supported. They work in the preview, but not in the MTA because the MTA can only access the out-of-the-box delivery schema.
  • Through <%@ value object="delivery" pre-processing

For the <%@ value object="delivery" xpath="@myCustomField" %> instruction, there is another limitation for deliveries sent via mid-sourcing. The custom field @myCustomField must be added to the nms:delivery schema on both marketing and mid-sourcing platforms.

Note: for delivery parameters/variables, use the following syntax (using the delivery object):

<%@ value object="delivery" xpath="variables/var[@name='myVar']/@stringValue" %>

did you try these options?

Regards,

Amit

dboat
Level 2
Level 2

Thanks Amit, we are currently using a method similar to option 1 however we also want to account for situations where the URL may be part of a larger block of copy/text.

For option 2 it seems like we have some barriers unless I am misunderstanding. Our delivery templates are used across multiple campaigns with a large amount of variability in the content shown. We cannot assume that one URL will be the same across campaigns so adding it as an additional script object does not seem possible.

Amit_Kumar
Community Advisor
Community Advisor

Hi,

You can create a delivery variable i.e myURLVar for this URL, and you can assign your URL value from additional data to this variable in the delivery script.

Use below for url in your delivery and this will work everywhere. you can use your parms like below if you have any.

<a heref="<%@ value object="delivery" xpath="variables/var[@name='myURLVar '']/@stringValue" %>?firstName=<%=recipeint.firstName%>" _label="custom url">my link value </a>

Regards,

Amit

dboat
Level 2
Level 2

We have a unique-per-recipient URL in the workflow, wouldn't setting it to a value in the delivery would make the URL the same for all recipient's?

Amit_Kumar
Community Advisor
Community Advisor

Hi,

If you have a unique link for every recipient then you can use a view, it will be similar to what you are using for MirrorPageUrl.

<a href="<%@ include view='customUrl' %>" _label="Custom Page" >web page link </a>

Regards,

Amit

dboat
Level 2
Level 2

Thanks Amit I appreciate the time you're taking. I tried as you suggested and created a view that simply returns <%= targetData.url %> with an @include instruction in the content form, however the tracking information was not automatically appended.

You mentioned the mirror page view, this view handles the appending of the tracking information, were you suggestion my new view should do the same?

Thanks.

Amit_Kumar
Community Advisor
Community Advisor

Hi,

I just did a quick test, and it is working fine for me

1413224_pastedImage_1.png

1413193_pastedImage_0.png

Hope this helps!

Amit

Ssb_94
Level 6
Level 6

Hi Amit,

Thanks for your inputs.

We too have similar requirement where URL for each and every recipient is unique. I have followed your approach of using VIEW, it worked and page is also getting redirected. However while checking tracking logs, it is tracked with placeholder <%= targetData.myUrl %>

Example of Tracked URL is: <% = targetData.myUrl %>{some other parameters}. I want exact and actual URL to be shown

How can we identify/decode the value from this scriptlet, any inputs

Regards,

Sri Bhargav

sidheshwarc5116
Level 3
Level 3

Hi, 

Were you able to resolve this ? I am having the same challenge where the tracking for a personalized URL using target data is not getting tracked. Any help is much appreciated. 

Sid