Good morning,
I am trying to retrieve these variables to add them as UTM parameters in a URL from a delivery but unfortunately when previewing they are always empty except the transaction ID.
I am using them like this inside the HTM Context.
<p>Message type: <%= delivery.messageType %></p>
<p>Operation ID: <%= delivery.operation_id %></p>
<p>Operation label: <%= delivery.operation.label %></p>
<p>Internal name of operation: <%= delivery.operation.internalName %></p>
The idea is to somehow fill in these variables.
(utm_medium ,utm_source ,utm_campaign,utm_content,utm_term)
to be able to concatenate them in my url, can you help me?
Thank you!
조회 수
답글
좋아요 수
조회 수
답글
좋아요 수
Thank you! How can I rescue the channel, I still see it empty?
Thank you very much.
조회 수
답글
좋아요 수
조회 수
답글
좋아요 수
yes, this always returns 0.
this is my complete code to try to parameterize my URLs dynamically.
i have saved it in a customization block, but i don't know how to implement it so that it can be added in the html urls when i do the delivery, sorry but i don't know how to do it otherwise. thank you very much 😉
<%
// Get the UTM fields from the current delivery.
var utmSource = (typeof variables !== 'undefined' && variables.utmSource) ? variables.utmSource : (delivery.source || "Source");
var utmMedium = (typeof variables !== 'undefined' && variables.utmMedium) ? variables.utmMedium : ("Email");
var utmCampaign = (typeof variables !== 'undefined' && variables.utmCampaign) ? variables.utmCampaign : (message.delivery.operation.label || "Campaign");
var utmContent = (typeof variables !== 'undefined' && variables.utmContent) ? variables.utmContent : (delivery.deliveryCode || "Content");
var utmTerm = (typeof variables !== 'undefined' && variables.utmTerm) ? variables.utmTerm : (delivery.operation_id || "Term");
// Construct the URL with UTM parameters
var finalUrl = "?utmSource=" + encodeURIComponent(utmSource) +
"&utmMedium=" + encodeURIComponent(utmMedium) +
"&utmCampaign=" + encodeURIComponent(utmCampaign) +
"&utmContent=" + encodeURIComponent(utmContent) +
"&utmTerm=" + encodeURIComponent(utmTerm);
<!-- HTML content for the block -->
%>
<%= finalUrl %>
In delivery I do this:
조회 수
답글
좋아요 수
Hi @JESUSBA1
You are getting a '0' because the Delivery Channel is defined as an Enumeration where values are numerical but labels string.
So if you have the OOO implementation 0 refers to "Email" channel.
I would suggest to check in your Deliveries data schema how you have defined the Channel enumeration to map the numerical value to the string representation if you want that.
thank you for your answer, when I use this code, the email never sends
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
</HEAD>
<BODY><a href="www.example.com<%@ include view='UMTOK' %>">link</a></BODY></HTML>
this can be used this way concatenated the include in the href?
조회 수
답글
좋아요 수
Hi @JESUSBA1
Could you please add logs of the delivery errors?
조회 수
답글
좋아요 수
hello, it stays in this state.
these are the variables of the task
조회 수
답글
좋아요 수
Hi @JESUSBA1
To see the delivery error logs you can take them from the campaign workflow itself by:
조회 수
답글
좋아요 수
That's where I'm looking at it, it doesn't give me any information beyond that.
Maybe it's giving an error to include it inside the href when concatenating it? this is my customization block.
조회 수
답글
좋아요 수
Solved, I managed to make it work by creating a content block to retrieve the variables and using the variable directly in the html.
조회 수
답글
좋아요 수
조회 수
Likes
답글
조회 수
Likes
답글