Solved

URL Parameters - Specify static Parameter in Header of Email

  • 5 May 2023
  • 2 replies
  • 66 views

Userlevel 4

Hello all,

I want to integrate manually defined URL Parameters for tracking purposes. Therefore, I added a liquid code in the email settings as a URL parameter value that checks if the static tracking variable exists and if so to use it as URL parameter. I then added some liquid in the email to capture the values:

 

Workspace settings > URL parameters

KEY: utm_content

VALUE: {% if email_content %}{{email_content}}{% endif %}

 

Email

{% capture email_content %}sale_autumn{% endcapture %}

 

Turns out, this does not work. utm_content is always empty. Is there any chance I can make this work?

 

Notes: I don’t want to use {{message.name}} or {{campaign.name}} and I tried it with “assign” instead of “capture”.

 

Thank for your help 😉

icon

Best answer by Byron 5 May 2023, 21:18

View original

2 replies

Userlevel 2

Hey Felix,

 

Byron here from the Customer.io technical support team.

 

From what I can determine, it won’t be possible to include email content in global UTM parameters. Our docs provide a list of the liquid tags that are available to use for UTM params at this time: https://customer.io/docs/url-parameters/#can-i-use-liquid-here.

 

There is a workaround you can try to see if it works for you.

On links that you want to include utm_content, add the disable-url-params class: https://customer.io/docs/url-parameters/#can-i-set-these-per-message.

The class only disables global parameters and will allow you to manually set your own URL parameters that do not have the same limitations as global parameters in workspace settings. 

 

Example:

{% assign email_content = 'autumn_sale' %}

<a href="https://example.com?utm_content={{email_content}}"

class="disable-url-params">a link with utm content</a>

 

Result from a test email: https://www.example.com/?utm_content=autumn_sale

 

Userlevel 4

Hey Byron,

thanks for the answer, the first link helped a lot, even though now I can’t get my plan to work...😉 Still good to know for the future.

 

Thank you!

Reply