Track which link was followed to make a contribution or register for an event

The most straight forward way

The simplest way to know whether people are giving to you based on a email campaign vs a link you sent via a social network versus just stumbling in from a web search is to create separate contribution pages or event registration pages. Then, publicize the different links via the different mediums and it's all quite easy.

Another way

However, this approach doesn't work well for events and, if you are constantly changing how you are promoting your contribution pages and maintaining dozens of different pages is very cumbersome. So, here is an alternative way.

Create a custom field

  1. Go to: Administer -> Customize Data and Screens -> Custom fields
  2. If you are tracking contribution pages, you will want to create a set of custom fields that extend Contributions. If you are tracking Events, it should extend "Participants." If you already have a set of Custom fields for either contributions or participants, you can use your existing set (assuming it applies to all contribution pages or all events). Otherwise, click Add set of custom fields and name it 'UTM tracking' (UTM stands for Urchin Traffic Monitor - it's a weird name that has become synonymous with tracking where someone came from who visited your site) and specify that it should be Used for Contributions of -Any- type or Used for Participants (Events) - -any-.
  3. Create one field called UTM source and make it an alphanumeric field of the type 'Text`
  4. After you save the field, note the ID that is assigned to this field. This is a bit tricky - after you click "Save" you will be returned to a list of fields - you should see just one, the one you created. If you hover of the Edit link next to it, you will see in the bottom corner of the browser what link it will open. It should end with something like: action=update&reset=1&gid=31&id=118. In this case the "id" is "118".

Add the field

If using a profle (e.g. contribution page)

Next, find the profile that is used on your contribution page or event page. With contribution pages, you will find it in the Include profiles tab. For Events, it will be in the Online Registration tab.

Click Edit next to your chosen profile.

Then, on the right side, expand the set of fields where you added the "UTM Source" field.

When you find the field, drag it into your profile.

Then, click the pencil icon next to it so you can edit the settings.

Change the label to say just "Source" - or whatever you want displayed to the donor.

Then, look for the 'view only` setting and change it to Yes.

Remember: If this profile is used for other events or contribution pages, those will also be updated to use this field. That may or may not be what you want. If you only want it to apply to a single contribution or event page, you may want to create a new profile for this purpose.

If using a webform

With a webform:

  1. You need to install the "Tokens" Drupal module first
  2. Add the field to your webform
  3. Edit the webform field
  4. In the default value, enter: [current-page:query:custom_118]
  5. You may want to make this field "hidden" (please test to make sure the value comes through)

Ready to test!

Now, open up your contribution page as if you are going to make a contribution or your web form

You should see the Source field and it should be empty.

Now, edit the address in your browser's location bar. It might read something like this:

https://training.ourpowerbase.net/civicrm/contribute/transact?reset=1&id=1

You will want to append a value to it based on the id number of your custom field and the value you want recorded for this contribution. If the custom field was 118 and you were publicizing this campaign via email, you would add '&custom_118=email` - for example:

https://training.ourpowerbase.net/civicrm/contribute/transact?reset=1&id=1&custom_118=email

Note: If you are using a webform or a page that doesn't already have an '?' in the URL, you have to add '?custom_118=email' instead of '&custom_118=email', e.g.:

https://training.ourpowerbase.net/node/123/?custom_118=email

Now, you can advertise your campaign using the same contribution page, but change the part after the equals sign, and whatever is there will show up in the source field of the contribution, allowing you to search by that field to see where they are coming from.

Category: 
Managing Contributions
Event Management