Add UTM tag to links, so other people know when users come from your site

So this is some marketing stuff I do, but it is useful. When you click a link on some site, to give some message to that site and owner or whoevere is taking care of marketing you can add some UTM tags to links so in their google analytics they see that message. So what do we do is I use display suite, create custom code field and use entity data to make new fields that look like this:


if (!empty($entity->field_collegamento)){
foreach ($entity->field_collegamento['und'] as $key => $value) {
     print '<div class="field-item">' . '<a href="'. $entity->field_collegamento['und'][$key]['url'] .'?utm_source=Visitors_from_adriadrop.com_contact_us_for_Drupal_work ">'
     .$entity->field_collegamento['und'][$key]['url'] . '</a></div>';