Profile vs. User in Adobe Target Profile Scripts: A Complete Guide | Community
Skip to main content
sriharshanaladala98
Level 2
March 27, 2025
Question

Profile vs. User in Adobe Target Profile Scripts: A Complete Guide

  • March 27, 2025
  • 2 replies
  • 970 views

When working with Adobe Target, understanding profile scripts is essential for tracking user behavior, storing preferences, and customizing experiences. However, many users get confused between profile and user when writing profile scripts.

In this blog post, we’ll break down the differences between profile and user, their use cases, and how you can leverage both for effective personalization.


What’s the Difference Between profile and user?

Feature profile user

ScopeStores persistent user data (across sessions & visits).Retrieves real-time session-specific data.
PersistenceData is stored permanently unless reset or expired.Data is only available during the session.
UsageUsed for tracking user history, preferences, and behavior over time.Used for fetching live details like IP, referrer, and user-agent.
Example Methodsprofile.set(), profile.get(), profile.increment(), profile.expireIn()user.header(), user.device(), user.ipAddress(), user.referrer()
Common Use CasesCounting visits, storing user categories, tracking preferences.Detecting current device, location, or referrer.

When Should You Use profile vs user?

ScenarioUse profileUse user
Track how many times a user visited the websiteYesNo
Store the last visited categoryYesNo
Get the user's current device typeNoYes
Detect if a user came from Google searchNoYes
Show a popup after 4 visits to a product page (PDP)YesNo
Get the user’s IP addressNoYes
Store a discount code that expires in 7 daysYesNo

Understanding when to use profile vs user ensures that data is stored and retrieved efficiently for better personalization.


Examples of profile and user in Adobe Target

Using profile for Persistent Tracking

Example: Counting the number of visits

var count = profile.get('visitCount') || 0;
count++;
profile.set('visitCount', count);
return count;

This persists across sessions—next time the user returns, the count continues.


Using user for Real-Time Data

Example: Checking if the user is on iOS

if (user.device().os === 'iOS') {
    return 'iPhone/iPad User';
}
return 'Other Device';

This only applies to the current session—doesn’t store anything for future visits.


Key Takeaways

  • Use profile for long-term user data tracking (e.g., visit counts, preferences).

  • Use user for real-time session-based information (e.g., device, IP, referrer).

  • You can combine both. Example: Store the user’s first device type in profile, but fetch the current device using user.

By leveraging both profile and user effectively, you can create powerful, personalized experiences in Adobe Target that adapt to both short-term interactions and long-term user behavior.

Let me know if any corrections?

 

2 replies

Rajneesh_Gautam_
Community Advisor
Community Advisor
March 28, 2025

Informative article @sriharshanaladala98 

 

Regards

Rajneesh

sriharshanaladala98
Level 2
April 1, 2025

Thank you for the feedback

DmytroPanchenk
Level 3
September 25, 2025

Thank you for the article. 

One question: does profile.set() work from profile scripts? Did you try?

UPD: I tried to invoke profile.set() from a profile script and got the following: 

TypeError: Cannot find function set in object [object com.adobe.tnt.edge.engine.javascript.variable.EngineProfileJavascriptVariable].