Skip to main content
Skip table of contents

Customize Google Analytics Using Template Tags

By default the system applies all defined Google Analytics tags to every link in your content. However, you can override this behavior by inserting Google Analytics tags into the template.  The ability to override and apply tags appears in versions v11.10.0 and newer.

Template Tags

When using Google Analytics outside of platform, a URL must be built out manually to include the Google Analytics parameters.  Google Analytics integration provides Template Tags to include each parameter within your tracking URLs.  By default all tags are applied to all URLs in the deployed content.  

These tags include:

Parameter

Tag

Source

%%utm_source%%

Medium

%%utm_medium%%

Campaign

%%utm_campaign%%

Content

%%utm_content%%

Term

%%utm_term%%

NOTE: Tags are not case sensitive. You may use upper or lower case (e.g. %%UTM_SOURCE%%) if you prefer.

Example:

A manually created URL may appear as:

http://www.mydomain.com?utm_campaign=my_campaign&utm_content=my_content&utm_medium=my_medium&utm_source=my_source&utm_term=my_term

To autofill your URLs in Templates and Articles based on the parameters defined in your Realm or Campaign settings, use the Template Tags within the URL as follows:

http://www.mydomain.com?utm_source=%%UTM_SOURCE%%&utm_medium=%%UTM_MEDIUM%%&utm_campaign=%%UTM_CAMPAIGN%%&utm_content=%%UTM_CONTENT%%&utm_term=%%UTM_TERM%%

The previous example uses the tag_name=tag_value approach (e.g. utm_source=%%UTM_SOURCE%%).  Alternately, you may use the following format instead: 

http://www.mydomain.com?%%UTM_SOURCE%%&%%UTM_MEDIUM%%&%%UTM_CAMPAIGN%%&%%UTM_CONTENT%%&%%UTM_TERM%%

When the campaign is deployed, each Template Tag is replaced with the Google Analytics value defined in your Realm or Campaign settings.

Using Specific Tags Only

Template Tags allow you to limit which URLs are converted to use Google Analytics, and which specific tags are placed on the URLs.  For example, if you may only wish to use the Source, Medium, and Campaign in one URL:

http://www.mydomain.com?utm_source=%%UTM_SOURCE%%&utm_medium=%%UTM_MEDIUM%%&utm_campaign=%%UTM_CAMPAIGN%%

This allows you flexibility in reporting within the Google Analytics interface.

 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.