我希望在将内容保存到数据库时自动替换链接以添加UTM跟踪代码。我正在使用Coldfusion。例如:
<p>So this is my sample text.
<a href="http://test.com/welkom">Click here</a> for the website.
<a href="http://test.com/news.cfm?news_id=10" class="test">Click here for the news</a>.
将其替换为:
<p>So this is my sample text.
<a href="http://test.com/welkom?utm_campaign=test&utm_source=Email">Click here</a> for the website.
<a href="http://test.com/news.cfm?news_id=10&utm_campaign=test&utm_source=Email" class="test">Click here for the news</a>.
有人可以帮我这个吗?