Difference between "profile." and "user."? | Community
Skip to main content
Level 4
July 6, 2021
Solved

Difference between "profile." and "user."?

  • July 6, 2021
  • 3 replies
  • 2794 views

In docs referencing Target profile parameters, I see two different ways of interacting with Target profile.

 

user.THING  and profile.THING

 

What's the difference and when do you use one vs. the other?

Note: https://experienceleague.adobe.com/docs/target/using/audiences/visitor-profiles/profile-parameters.html?lang=en#objects-and-methods

 

References profile.get() and user.get() 

 

Code example here:
https://experienceleague.adobe.com/docs/target/using/audiences/visitor-profiles/profile-parameters.html?lang=en#concept_8C07AEAB0A144FECA8B4FEB091AED4D2

 

Uses both "user." and "profile."

 

Thanks

 

Thank you

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Andrey_Osadchuk
  1. When you want to set a persistent attribute in a JS implementation, you set a profile.SOMETHING parameter.
  2. AT creates some profile parameters automatically too. For example, profile.sessionCount, profile.geolocation.country.
  3. Each profile script becomes user.PROFILESCRIPTNAME. When you want to reference a profile script in another profile script or in an experience as a dynamic placeholder, you can do it via user.PROFILESCRIPTNAME
 

3 replies

ambikaTewari_ATCI
Community Advisor
Community Advisor
July 7, 2021

Hi @j2_2 profile.THING is profile parameter of an user profile . user.THING is the profile script

J2_2Author
Level 4
July 7, 2021
Thanks for the answer - what is the difference in practical terms? It looks as though they are interchangeable how they are used, and both can save to and pull from, the Visitor Profile, when fired "on the page".
Andrey_Osadchuk
Andrey_OsadchukAccepted solution
Level 10
July 20, 2021
  1. When you want to set a persistent attribute in a JS implementation, you set a profile.SOMETHING parameter.
  2. AT creates some profile parameters automatically too. For example, profile.sessionCount, profile.geolocation.country.
  3. Each profile script becomes user.PROFILESCRIPTNAME. When you want to reference a profile script in another profile script or in an experience as a dynamic placeholder, you can do it via user.PROFILESCRIPTNAME
 
montazm22689072
New Member
March 3, 2024

It looks like when you Pass information into Target -- for example, using adobe.target.trackEvent or mboxCreate as seen here

 

adobe.target.trackEvent({ "mbox": "clicked-cta", "params": { "param1": "value1" } }); // source: https://experienceleague.adobe.com/docs/target-dev/developer/client-side/at-js-implementation/functions-overview/adobe-target-trackevent.html?lang=en

 

or here

 

mboxCreate("landingpage", "profile.keyword=World Cup"); // source: https://experienceleague.adobe.com/docs/target/using/experiences/offers/passing-profile-attributes-to-the-html-offer.html?lang=en

 

-- you use profile. syntax to retrieve this data in HTML (for dynamic content) like this

 

<h1>Get your ${profile.keyword} information here!</h1> <p>The value ${profile.param1} was passed in.</p>

 

or retrieve it in a profile script like this

 

let example1 = profile.get("param1"); let example2 = profile.get("keyword");

 

 

Whereas, user. syntax is used to reference variables created inside of the profile script.

From the documentation, it says this,

 

Implementation

For profile parameters passed into an mbox, use the syntax:

${profile.parameter}

For profile parameters created in a profile script, use the syntax:

${user.parameter}

 

source: https://experienceleague.adobe.com/docs/target/using/experiences/offers/passing-profile-attributes-to-the-html-offer.html?lang=en

 

Also see this for profile attributes for more on user. syntax https://experienceleague.adobe.com/docs/target/using/audiences/visitor-profiles/profile-parameters.html?lang=en