Parameters provide additional information about the ways in which users interact with your website or app. For example, when someone views a product you sell, you can include parameters that describe the product they viewed, such as the name, category, and price.
The automatically collected and enhanced measurement events include parameters by default. Google also provides a set of required and optional parameters to include with each recommended event. Additionally, you can add more event parameters when you need them.
Set up parameters for an event
Use the following drop-downs to see information about how to set up parameters for an event:
Google tag (Websites)
To add parameters to an event, add a third value to the gtag
snippet:
gtag('event', '<
event_name>
', { <event_params> });
For example, the following screen_view
event includes two parameters:
gtag('event', 'screen_view', {
'app_name': 'myAppName',
'screen_name': 'Home'
});
To learn more about setting up events, see Set up events.
Google Tag Manager (Websites)
Google Analytics for Firebase (Mobile apps)
Set up parameters for every event
Google Analytics lets you set parameters once and use the parameters for all the events on a page or screen. Use the following drop-downs to see information about how to set up parameters for every event:
Google tag (Websites)
The config
command in the Google tag snippet lets you set up parameters for every event on a web page. For example, to change the page title, add the page_title
parameter to your config
command.
gtag('config', 'MEASUREMENT_ID', {
'page_title': 'Travel Destinations',
'currency': 'USD'
});
If you add more than one product to your page, use the set
command instead of the config
command so all the products inherit the parameters you set. Place the set
command above the config
command.
gtag('set', {
'page_title': 'Travel Destinations',
'currency': 'USD'
});
gtag('config', 'MEASUREMENT_ID_1');
gtag('config', 'MEASUREMENT_ID_2');
gtag('config', 'MEASUREMENT_ID_3');
Google Tag Manager (Websites)
Google Analytics for Firebase (Mobile apps)
See parameter values
Some parameters automatically populate the prebuilt dimensions and metrics in Google Analytics. The parameters on the automatically collected and enhanced measurement events, as well as the required and optional parameters you send with the recommended events, populate pre-built dimensions and metrics.
Other parameters require you to create custom dimensions and metrics in order to see the parameter values in Google Analytics. Whenever you create a custom parameter, you need to create a corresponding custom dimension or metric so you can see that data.