trackProfileAttribute

❗️

Deprecated

This method is no longer recommended. Audience Manager is no longer available in the latest product version.

The trackProfileAttribute() method sets profile attributes in Audience Manager. The attributes can be sent to Audience Manager with a screen view or other event.

Attributes are all kinds of information about a user that help you build audiences for marketing and advertising purposes.

Syntax

const profileAttributes: TrackProfileAttributes = [
  { name: 'name', value: 'value' },
  { name: 'name', value: 'value' },
];
// Profile attributes can be also a single object:
// const profileAttributes: TrackProfileAttributes = { name: 'name', value: 'value' };
await PiwikProSdk.trackProfileAttributes(profileAttributes);

Parameters

profileAttributes

An object containing two properties.

name (string, required)

The name of the profile attribute. Example: plan type.

value (string, required)

The value of the profile attribute. Example: premium.

Examples

To set the attribute plan type with the value premium :

const profileAttributes: TrackProfileAttributes = [
  { name: 'plan type', value: 'premium' },
];
// Profile attributes can be also a single object:
// const profileAttributes: TrackProfileAttributes = { name: 'name', value: 'value' };
await PiwikProSdk.trackProfileAttributes(profileAttributes);

Notes

  • Each event always sends the following attributes: Site or app ID, Visitor ID and Device ID.
  • If setAnonymizationState(false) is set and User ID and Email are set, each event will also send User ID and Email.
  • You can see all added attributes in Audience Manager > Profile.

Related methods