Missing styles for tracked links in snippet updated via API

Anonymous
Not applicable

Missing styles for tracked links in snippet updated via API

I'm using Marketo's REST API to update snippet's content which is HTML code with several URLs. By default all links are tracked and are replaced when emails are sent.

The issue is that inline styles specified for those a elements disappear. Example:

Snippet's <a class="mktNoTrack" href="http://example.com" style="color: #5b6770; text-decoration: none;" target="_blank">Example</a>

is converted in email to

<a href="http://go.example.com/123" target="_blank">Example</a>

class="mktNoTrack" doesn't make any use, it is just ignored. However, if I open the snippet for edit in Marketo's dashboard and it gets autosaved the styles appear okay in tracked link. Very weird. As snippet's update is automated opening it manually each time is not a solution to the problem

Any ideas how to deal with it?

Tags (2)
6 REPLIES 6
SanfordWhiteman
Level 10 - Community Moderator

Re: Missing styles for tracked links in snippet updated via API

First: why are you trying to add mktNoTrack, yet not caring that it doesn't function in this context? Do you want the links to track or not?

Anonymous
Not applicable

Re: Missing styles for tracked links in snippet updated via API

Preferably yes, I'd like to have them tracked. Sorry for the example, my intention was to show that even with the class the URL is still replaced, so the class is just ignored (again only when snippet is updated and approved via API and not opened after that in dashboard's UI).

SanfordWhiteman
Level 10 - Community Moderator

Re: Missing styles for tracked links in snippet updated via API

OK, I can see how this serves as another demonstration (it was confusing because mktNoTrack is a "server-side" class unlike presentation-only CSS classes).

Let me see if I can replicate this.  Sounds like a reportable bug so far.

SanfordWhiteman
Level 10 - Community Moderator

Re: Missing styles for tracked links in snippet updated via API

Actually, I couldn't repro this.  Are you sure you reapproved the Email after programmatically changing + approving the Snippet?

Anonymous
Not applicable

Re: Missing styles for tracked links in snippet updated via API

Yep, I'm sure. Here's what I'm doing:

1. Update snippet content and approve it via API requests

2. Create an email template with editable block

3. Create an email from this template and replace the block with snippet

4. Unapprove/approve the email

5. Open email preview - everything looks okay (URLs are not replaced yet)

6. Send email to test email address - the result email has new URL, the only thing from the old one is the `target="_blank"`.

Anonymous
Not applicable

Re: Missing styles for tracked links in snippet updated via API

Could you please show your steps too? Maybe I'm missing something here?