Install
Install the Tealium plugin in your Unity application.
We have discontinued active development of the Tealium for Unity plugin. If you use this plugin and need assistance with it, contact Tealium Support.
Tealium for Unity provides the Tealium native mobile libraries in your Unity application for iOS and Android.
Requirements
Sample app
Explore the iOS or Android sample apps to familiarize yourself with the Tealium library, tracking methods, and best practice implementation.
For the iOS app, open the Examples/TealiumUnity-iOS/Unity-iPhone.xcodeproj
file in XCode. For the Android app, open the Examples/TealiumUnity-Android/TealiumUnity-Android.apk
file in Android Studio
Alternatively, drag the contents of Assets/Scenes
and Assets/Scripts
into your project, then import Tealium.unitypackage
.
Install
Tealium only supports Android and iOS platforms within Unity.
Package Import
The recommended installation method is to use the TealiumUnityPlugin
as a .unitypackage
.
- Visit the GitHub releases page and download
Tealium.unitypackage
from the latest release. - Create a new Unity project or open an existing project.
- Import the
Tealium.unitypackage
to your project by selecting Assets > Import Package > Custom Package. - Add the following import statement to your project:
using TealiumCommon;
Manual
To manually install Tealium for Unity, for iOS or Android, into your Unity application:
- Clone the GitHub repo.
- Copy the
Assets/Plugins
andAssets/Tealium
folders into your project. - Add the following import statement to your project:
using TealiumCommon;
iOS
After you build and run your project for the first time, manually link the Tealium frameworks within XCode:
- Click on the Unity-iPhone project.
- Click on the Build Phases tab.
- Expand the Embedded Frameworks section.
- Copy all the frameworks located in the
Frameworks/Plugins/iOS
folder into the Embedded Frameworks section.
TealiumUnityPlugin
has a dependency on the Unity plugin JSON.net
to serialize and deserialize objects. If JSON.net
is already included in your project, you may need to remove it in order to avoid conflicts.
Initialize
Initialize the Tealium instance with the Initialize()
method, as shown in the following example:
private TealiumConfig config = new TealiumConfig("tealiummobile",
"demo",
TealiumEnvironment.DEV,
new List<Dispatchers> {
Dispatchers.TagManagement,
Dispatchers.Collect,
Dispatchers.RemoteCommands },
new List<Collectors> {
Collectors.AppData,
Collectors.DeviceData,
Collectors.Lifecycle,
Collectors.Connectivity },
logLevel: LogLevel.Dev,
batchingEnabled: false,
visitorServiceEnabled: true);
TealiumUnityPlugin.Initialize(config);
This page was last updated: June 25, 2024