Add authentication to an event or visitor function
This article provides information on adding authentication to an event or visitor function.
Add Authentication to an Event or Visitor Function
Functions require authentication to access some service providers, such as Facebook or Google. You can add authentication to a function in the Advanced tab of the Tealium Functions code editor. When you add an authentication, an access token is returned, which the function then uses to make requests from the service. The token is typically a string of characters that is used to identify a user or an application. Functions must provide an authentication token to make API calls to Facebook or Google. To get an authentication token, you need an account with the service provider.
The steps for adding an authentication vary depending on the authentication selected. The following sections provide instructions for adding Facebook, Google, API Key, and UID 2.0 authentication. For information on adding OAUTH 2.0 authentication, see Adding OAuth 2.0 Authentication to an Event or Visitor Function.
Add Facebook Authentication
You must log in to Facebook before adding a Facebook authentication. To add Facebook authentication, use the following steps:
- After you create a function, click the Advanced tab.
- Log in to your Facebook Ad account.
- Click Assign Authentications.
- Click +Add Authentication, then select Facebook Authentication, and click Continue.
- Enter a Name and click Connect to Facebook.
An authentication token is returned in User Token. - Click Add.
Add Google Authentication
To add Google authentication, use the following steps:
- After you create a function, click the Advanced tab.
- Click Assign Authentications.
- Click +Add Authentication, then select Google Authentication, and click Continue.
- Enter a Name, the Developer Token name, and click Connect to Google.
An authentication token is returned in User Token. - Click Add.
Add API Key Authentication
To add an API key authentication, use the following steps:
- After you create a function, click the Advanced tab.
- Click Assign Authentications.
- Click +Add Authentication, then select API Key, and click Continue.
- Enter a Name for the token, and click Next.
A unique access token name for the function is generated based on the specified Name. - Enter the API Key. After you Save and Publish, the API Key is obfuscated and no longer visible.
- [Optional] Enter a host name to whitelist.
- To add an additional Host Name to whitelist, click + Add Host Name and enter the name.
- Click Add.
- Click Done.
Add UID 2.0 Authentication
To add UID 2.0 authentication, use the following steps:
- After you create a function, click the Advanced tab.
- Click Assign Authentications.
- Click +Add Authentication, then select Unified ID 2.0 Authentication, and click Continue.
- Enter a Name for this authentication and click Add.
The token for UID2.0 is returned inUID2.0_Tealium
, which can now be used in your code.
Delete an Authentication
Authentications that are assigned to a function or to a connector cannot be deleted. To delete an authentication, use the following steps:
-
On the Advanced tab, click Assign Authentications.
-
In the menu for the authentication to be deleted, click Delete.
If the authentication is assigned to a function or a connector, a message is displayed, listing the functions or connectors to which it is assigned. Click Close. -
If the authentication is not assigned to a function or to a connector, a confirmation dialog displays. Click Delete.
This page was last updated: May 24, 2023