Adobe Visitor Service Module
Learn to install Tealium Adobe Visitor Service Module for React Native.
Tealium for React Native allows you to use the Tealium mobile libraries (iOS, Android) in your React Native application.
How It Works
Tealium mobile libraries are integrated into your React Native application using one of the following two methods:
- NPM package (recommended)
- Manual via GitHub
Requirements
- Access to your native build environments
- Tealium for React Native 2.2.0+
- React Native 0.63+ and tools installed
- Tealium iQ Mobile Profile
- Android Studio or Xcode
- Tealium for Android or Tealium for iOS
Install (NPM/YARN)
To install the Tealium Adobe Visitor module for React Native with NPM:
-
Follow the installation instructions for the main
tealium-react-native
library installation here. Ensure you have installed at least version 2.2.0 or above. -
Navigate to the root of your React Native project.
-
Download and install the
tealium-react-native-adobe-visitor
package with the following command:yarn install tealium-react-native-adobe-visitor
JavaScript
To import the relevant classes into your app, do the following:
import TealiumAdobeVisitor from 'tealium-react-native-adobe-visitor';
import { TealiumAdobeVisitorConfig } from 'tealium-react-native-adobe-visitor/common';
Initialize
Configure the Adobe Visitor module prior to initializing the main Tealium React Native integration.
let adobeVisitorConfig: TealiumAdobeVisitorConfig = {
adobeVisitorOrgId: "ADOBE-ORG-ID",
adobeVisitorRetries: 1,
adobeVisitorAuthState: AuthState.authenticated,
// If you do not set a value for any of the following three lines, remove that line.
adobeVisitorExistingEcid: "",
adobeVisitorDataProviderId: "",
adobeVisitorCustomVisitorId: ""
}
TealiumAdobeVisitor.configure(adobeVisitorConfig);
API Reference
After the Adobe Visitor Module and the main Tealium React Native integration have both been initialized, you can link an existing Adobe visitor.
linkEcidToKnownIdentifier(id, providerId, authState, callback)
Links existing ECID to known Identifier.
TealiumAdobeVisitor.linkEcidToKnownIdentifier(id, providerId, authState, value => {
console.log("AdobeVisitor Data: " + JSON.stringify(value))
});
getAdobeVisitor(callback)
Get the current Adobe visitor information
TealiumAdobeVisitor.getAdobeVisitor(value => {
console.log("Current Adobe Visitor: " + JSON.stringify(value))
});
decorateUrl(url, callback)
Decorates the URL with ECID visitor data.
TealiumAdobeVisitor.decorateUrl(("https://tealium.com", value => {
console.log("Decorated URL: " + value);
});
getUrlParameters(callback)
Retrieves the Adobe Visitor URL parameters to be appended to a URL.
TealiumAdobeVisitor.getUrlParameters(value => {
if (value === null || value === undefined) {
console.log("Adobe Visitor was null");
return;
} else {
for (var key of Object.keys(value)) {
// Result: key = adobe_mc
// value = MCMID=1234|MCORGID=12345@AdobeOrg|TS=1655826247
// Only for demonstration purposes; call some method in your app that decorates the URL and then launches your webview
console.log("Retrieved URL Parameters: ", key + "=" + value[key]);
break;
}
}
});
resetVisitor()
Reset current visitor.
TealiumAdobeVisitor.resetVisitor();
This page was last updated: March 1, 2024