Trustlytics Support Center > Goals > Manage goals (Add a new Goal)

Manage goals (Add a new Goal)

With the “Goals” section, you can measure the success of your website based on company goals or personal goals. This includes things like acquiring potential customers, online sales, or improving brand awareness or website visibility.



Setting goals may be the most important part of analysis tracking. Well-defined goals can help you gather information about the type of visitors who convert on your website (perform the desired action), which marketing channels these visitors come from, and why some visitors do not perform a conversion (do not perform the desired action). The data on goals is useful for identifying areas on your website that need improvement, so you can convert more visitors into leads (perform the desired action). Additionally, this data helps you identify the most effective marketing channels and focus on them.



Every website has specific actions that visitors perform and contribute to achieving goals. These actions can vary, but they are often as simple as visiting a specific page or filling out an online form. Since these goals vary depending on the website, you will need to either use our built-in automatic trigger or manually configure them to collect valuable data. And that's exactly what we explain to you in detail here.




Add a new Goal (with automatic trigger)



Add a new Goal (manually)



Edit goals




Add a new Goal (with automatic trigger)

If you haven't set a goal yet, you can select the option “Add a new Goal” in the menu. By clicking on it, the integrated automatic trigger creator will open in the main window.



If you have already created a goal, the menu and the main window will look different. You can find an explanation of this in the section «Edit goal».



Start by entering a name for your goal in the “Goal Name” field.



Choose a meaningful name that is easy to identify, such as “Download Brochure”. It can also be helpful to establish a specific naming convention if you have many similar goals. For example, you could use a pattern like “Download Brochure — Product X” and “Download Brochure — Product Z” to easily find and reference similar goals.

In the “Description” field, there is also the possibility to add a brief description to remember more specific details or the context of the goal.

Now you need to select a trigger. The following options are available:



Visit a given URL (page or group of pages) (more info)

The specified website is being accessed by a visitor.



Visit a given Page Title (more info)

A visitor calls up the website with the specified page title.



Send an event (more info)

A visitor triggers the specified event.



Download a file (more info)

A visitor downloads the mentioned file.



Click on a Link to an external website (more info)

A visitor clicks on the specified external link on one of your web pages.



Stay for a certain amount of time (more info)

A visitor stays on your website for the specified duration.

Visit a given URL (page or group of pages)

Here we explain the trigger “Visit a given URL (page or group of pages)” and the various setting options for it.



Select the value “when visitors” in the field “Goal is triggered” and then on the right side, choose the option “Visit a given URL (page or group of pages)”.

Important: If you choose the value “manually”, you will need to change the tracking code manually. This option is explained below and is only recommended for advanced users.



In the field “where the URL”, you now have three different options available to set a target event:



contains

The “contains” option triggers the goal when a visitor visits a page whose URL contains the content entered by you in the “Pattern” field. This method is particularly helpful when you want to compare a series of web pages with a similar topic, such as all blog pages about mobile phones. For example, if you enter “blog/mobilephone” in the “Pattern” field, the goal will be triggered as soon as a visitor visits any of the following pages on your website:

https://www.mycompany.com/blog/mobilephone.html

https://www.mycompany.com/blog/mobilephone-brandX.html

https://www.mycompany.com/blog/mobilephone-comparison.html

is exactly

With the “is exactly” option, you can proceed extremely precisely so that the goal is only triggered when the exact URL you specified in the “Pattern” field is entered. For example, if you enter “https://www.mycompany.com/blog/mobilephone.html” in the “Pattern” field, the goal will be triggered as soon as a visitor reads the blog post on this URL.

matches the expression

The “matches the expression” option is the most advanced way to determine a goal. This method uses regular expressions, also known as regEx. If you are not familiar with regEx, we strongly recommend that you follow our examples closely.



If you enter “(.*)\/mobilephone(.*)” in the “Pattern” field, which would match any page with /mobilephone in the URL in this scenario, the goal will be triggered when a visitor visits any of the following pages on your website:

https://www.mycompany.com/blog/mobilephone.html

https://www.mycompany.com/blog/mobilephone-brandX.html

https://www.mycompany.com/blog/mobilephone-comparison.html

https://www.mycompany.com/shop/mobilephone/

https://www.mycompany.com/shop/mobilephone/mobilephone-productX.html

https://www.mycompany.com/shop/mobilephone/mobilephone-productZ.html

If you want to enable tracking for entire directories, enter “(.*)\/contact\/(.*)” (equivalent to /contact/) in the “Pattern” field. The goal will be triggered whenever a visitor visits pages in the following directories:

https://www.mycompany.com/contact/

https://www.mycompany.com/support/contact/




Visit a given Page Title

Here we explain the trigger “Visit a given Page Title” and the various setting options for it.



Select the value “when visitors” in the field “Goal is triggered” and then on the right side, choose the option “Visit a given Page Title”.

Important: If you choose the value “manually”, you will need to change the tracking code manually. This option is explained below and is only recommended for advanced users.



In the field “where the Page Title”, you now have three different options available to set a target event:



contains

The “contains” option triggers the goal when a visitor visits a page whose title contains the content entered in the “pattern” field. This method is particularly helpful when you want to compare a series of web pages with a similar topic, such as all blog pages about mobile phones. For example, if you enter “mobile phone” in the “pattern” field, the goal will be triggered as soon as a visitor visits one of the pages with the following titles on your website:

My 3 best mobile phones

The new mobile phone from X

My big mobile phone comparison

is exactly

With the “is exactly” option, you can proceed extremely precisely so that the goal is only triggered when the exact title you entered in the “Pattern” field is entered. For example, if you enter “My big mobile phone comparison” in the “Pattern” field, the goal will be triggered as soon as a visitor reads the blog post “My big mobile phone comparison”.

matches the expression

The “matches the expression” option is the most advanced way to determine a goal. This method uses regular expressions, also known as regEx. If you are not familiar with regEx, we strongly recommend that you follow our examples closely.



If you enter “(.*)mobile” in the “Pattern” field, for example, which would match any page that has “mobile” in the page title in this scenario, the goal will be triggered when a visitor visits any of the following pages on your website:

My 3 best mobile phones

The new mobile phone from X

My big mobile phone comparison

All mobile phones in the mycompany.com shop

Buy mobile phone X from A

Buy mobile phone Z from B


Send an event

Here we explain the trigger “Send an event” and the various setting options for it.



Select the value “when visitors” in the field “Goal is triggered” and then on the right side, choose the option “Send an event”.

Important: If you choose the value “manually”, you will need to change the tracking code manually. This option is explained below and is only recommended for advanced users.



In the field “where the” you now have twice three different options available to set a target event:



In the first selection menu, you have the option to choose between Event Category, Event Action, and Event Name. Depending on how general (Category) or specific (Name) you want to track, you can select the corresponding event. For our example, we will use the previously explained scenario of contacting with the action “Click Email link” and the name “info@mycompany.com”.



In the second selection, you have three different options available to set a target event:



contains

The “contains” option triggers the goal when a visitor visits a page whose Event Category contains the content entered in the “Pattern” field. This method is particularly useful when you want to compare events in the Event Category, for example, all events in the Contact category. For example, if you have selected the “Event Category” and entered “Contact” in the “Pattern” field, the goal will be triggered as soon as a visitor visits one of your web pages, triggers the event there, and belongs to the Contact category.

Email link website (event trigger: click on link)

Email link support website (event trigger: click on link)

Contact form website (event trigger: submit form)

Contact form support website (event trigger: submit form)

is exactly

With the “is exactly” option, you can proceed extremely precisely so that the goal is only triggered when the exact action you specified in the “Pattern” field is triggered. For example, if you have selected the “Event Action” and enter “Click Email link” in the “Pattern” field, the goal will be triggered as soon as a visitor clicks on the email link on the website or the support website.

matches the expression

The “matches the expression” option is the most advanced way to determine a goal. This method uses regular expressions, also known as regEx. If you are not familiar with regEx, we strongly recommend that you follow our examples closely.



If you have selected the “Event Name” for example and enter “(.*)info@” in the “Pattern” field, which would match any action that has info@ in the event name in this scenario, the target will be triggered as soon as a visitor clicks on the following link:

E-Mail link website (sends an email to info@mycompany.com)


Download a file

Here we explain the trigger “Download a file” and the various setting options for it.



Select the value “when visitors” in the field “Goal is triggered” and then on the right side, choose the option "Download a file".

Important: If you choose the value “manually”, you will need to change the tracking code manually. This option is explained below and is only recommended for advanced users.



In the field “where the filename” you now have three different options available to set a target event:



contains

The “contains” option triggers the goal when a visitor downloads a file whose name contains the content entered in the “Pattern” field. This method is particularly useful when comparing downloads, such as all brochures. For example, if you enter “brochure” in the “Pattern” field, the goal will be achieved as soon as a visitor downloads a file with the content “brochure”:

brochure-product-x.pdf

brochure-product-x.doc

brochure-product-z.pdf

brochure-product-z.doc

is exactly

With the “is exactly” option, you can proceed extremely precisely so that the goal is only triggered when the exact file you specified in the “Pattern” field has been downloaded. For example, if you enter “https://www.mycompany.com/downloads/brochure-product-x.pdf” in the “Pattern” field, the goal will be triggered as soon as a visitor downloads the file “brochure-product-x.pdf”.

matches the expression

The “matches the expression” option is the most advanced way to determine a goal. This method uses regular expressions, also known as regEx. If you are not familiar with regEx, we strongly recommend that you follow our examples closely.



If you enter “(.*).pdf” into the “Pattern” field, which would match any file with the .pdf extension in this scenario, the trigger will be activated as soon as a visitor downloads any of the following files:

brochure-product-x.pdf

brochure-product-z.pdf

pricelist.pdf

comparison-mobile-phone-x-and-z.pdf


Here we explain the trigger “Click on a Link to an external website” and the various setting options for it.



Select the value “when visitors” in the field “Goal is triggered” and then on the right side, choose the option “Click on a Link to an external website”.

Important: If you choose the value “manually”, you will need to change the tracking code manually. This option is explained below and is only recommended for advanced users.



In the field “when the external website URL”, you now have three different options available to set a destination event:



contains

The “contains” option triggers the goal when a visitor clicks on a link from an external website that contains the content entered in the “Pattern” field. This method is particularly useful when you want to compare multiple links from the same external website, such as all links to a partner website. For example, if you enter “company.com” in the “Pattern” field, the goal will be achieved as soon as a visitor clicks on a link with the content “company.com”:

www.company.com

www.company.com/about-us.hmtl

www.company.com/product-xz.html

www.company.com/product-ab.php

is exactly

With the “is exactly” option, you can proceed extremely precisely so that the goal is only triggered if the exact link you specified in the “Pattern” field is clicked. For example, if you enter “www.company.com/product-xz.html” in the “Pattern” field, the goal will be triggered as soon as a visitor clicks on this link.

matches the expression

The “matches the expression” option is the most advanced way to determine a goal. This method uses regular expressions, also known as regEx. If you are not familiar with regEx, we strongly recommend that you follow our examples closely.



If you enter “https://www.company.com\/(.*)\/?affiliate=72727” into the “Pattern” field, which would match any link that has “https://www.company.com\/(.*)\/?affiliate=72727” in the link in this scenario, the target will be triggered as soon as a visitor clicks on one of the following links:

www.company.com/product-xz.html?affiliate=72727

www.company.com/product-ab.php?affiliate=72727

www.company.com/overview/product-df.html?affiliate=72727

www.company.com/product-hg/?affiliate=72727


Stay for a certain amount of time

Here we explain the trigger “Stay for a certain amount of time” and the various setting options for it.



Select the value “when visitors” in the field “Goal is triggered” and then on the right side, choose the option “Stay for a certain amount of time”.

Important: If you choose the value “manually”, you will need to change the tracking code manually. This option is explained below and is only recommended for advanced users.



You have no option to make a selection in the field “where the visit duration is”. The value “Greater than” is already pre-set and cannot be changed.



In the field “Time in Minutes”, you can now set how long a visitor must stay on your website before the goal is triggered. This value varies depending on the website, and it is important to consider what is an appropriate duration for your website. In our example, we choose 5 minutes. Therefore, we enter the number “5” in the field “Time in Minutes”.

Important: The input of seconds is done in decimal values. For example, 2 ½ minutes would be entered as 2.5.



Let's now continue with the remaining settings.



Except for the trigger “Stay for a certain amount of time” it is now possible to optionally enable uppercase and lowercase letters.



As a rule, capitalization is turned off because this setting is more forgiving of spelling errors than when it is enabled. Therefore, we recommend that you do not activate this option.

Except for the trigger “Stay for a certain amount of time”, you will see the option “Allow multiple conversions per visit”.



The default setting for this option is “Goal can only be converted once per visit”. In most cases, this setting is correct. However, if you have a goal that can be achieved multiple times, select the setting “Allow Goal to be converted more than once per visit”.



In the end, you can set a revenue for the goal.



Not every goal will lead to revenue, but many will, either directly or indirectly. In the “Goal Revenue (optional)” field, you have the possibility to enter a revenue value for the goal. It doesn't have to be an exact value and doesn't necessarily have to be associated with a sale, but it can help you evaluate the success of your marketing efforts.



If, for example, you know that on average every hundredth download of your brochure for product X results in a sale worth 500 CHF, this corresponds to an average of about 5 CHF per lead. Therefore, you could set the revenue goal at 5 CHF and assume that by the hundredth lead, at least one sale worth 500 CHF has probably been made.

Once you have filled in all the fields, you can click the “Add Goal” button below and your goal will be created.




Add a new Goal (manually)

The automatic triggers capture almost everything. However, if there is a goal that is not captured by the automatic trigger, you can add it manually. One possible goal could be, for example, when a visitor submits a form.



Create a goal according to the description above under “Add a new Goal (with automatic trigger)”.



Select the “manually” option in the “Goal is triggered” field now.



With this selection, all automated selection options are hidden.



Make the remaining settings and save your desired goal.

Then navigate to the “Manage Goals” menu item. There you will find an overview of your created goals. The ID of the previously created goal is located in the first position. Remember this number, in our case it is 1.

Now open your website with a suitable editor, where the form is located. Now you need to customize the submit button.



If you simplify it, the submit button looks like this:

<button type="submit">Submit</button>



Now you need to add the “onClick” function to your button using JavaScript. Within the onClick function, we will now inform Trustlytics that a click is a goal and which one exactly.



If you simplify it, the submit button now looks as follows:

<button type="submit" onclick="_paq.push(['trackGoal', 1]);">Submit</button>



When the button is clicked, the onClick function executes the action “_paq.push”. This, in turn, informs Trustlytics through “trackGoal” that it is a goal and specifies the specific goal based on the number “1”.



This is just one example out of many. There are no limits to your creativity.




Edit goals

If you have already created goals, it is possible to adjust them easily.



Navigate to the menu item “Manage Goals”. There you will find an overview of your created goals.



On the right side is the “Edit” icon. When you click on it, the “Update Goal” view opens, which is the same as the view called “Add a new Goal” that you have already learned about above.

Make the necessary changes and then click on the “Update Goal” button to save them.

To create a new goal, simply click on the “Add a new Goal” button in the overview below and set your desired goal.

If you want to remove a goal, you can click on the “Delete” icon on the right side in the overview. A pop-up window will then appear, asking you if you really want to delete the goal. If you click on the “Yes” button, the goal will be deleted..