Expand my Community achievements bar.

SOLVED

programatically adding profile properties to user profiles from the internets

Avatar

Level 2

is it possible to programatically add profile properties to a user profile from web ?   I can't find anything on if this is possible or how to do it.  I'm trying to make a call from a page on my site that would add a user properties (user.someProp) to the visitor of the site so I can use it in a Profile Script for audience segmentations.

1 Accepted Solution

Avatar

Correct answer by
Level 9

Yes @RJBu , 

 

These parameters can be fetched in profile script using user.get('UserGroup'). 

 

And if you want to create an audience for these parameters, you can directly create an audience in adobe target without having the need of profile script. 

In audience, you can create the following rule :

visitor profile -> UserGroup equals 'newUser'. 

 

Hope it helps. 

 

Best regards, 

Vaibhav Mathur

View solution in original post

5 Replies

Avatar

Level 9

Hi @RJBu , 

 

You can pass profile attributes in a webpage, just like you pass normal mbox/page parameters. 

For example, You can use the below code for passing a profile parameter let's say UserGroup : 

 

function targetPageParams(){
return "profile.UserGroup=newUser";
}

 

You can also pass the profile parameters in a JSON format as given below : 

 

targetPageParams = function() {
return {
"profile": {
"UserGroup": "NewUsers"
}
};
};

 

Document for reference : https://experienceleague.adobe.com/en/docs/target-dev/developer/client-side/global-mbox/pass-paramet...

 

Hope it helps, 

 

Best Regards, 

Vaibhav Mathur

Avatar

Level 2

would these properties then be accessible in the profile scripts (via UserGroup=newUser in your example) ?

Avatar

Correct answer by
Level 9

Yes @RJBu , 

 

These parameters can be fetched in profile script using user.get('UserGroup'). 

 

And if you want to create an audience for these parameters, you can directly create an audience in adobe target without having the need of profile script. 

In audience, you can create the following rule :

visitor profile -> UserGroup equals 'newUser'. 

 

Hope it helps. 

 

Best regards, 

Vaibhav Mathur

Avatar

Level 2

Okay I tried this but for some reason it did not worked.  I may just opened a support ticket for this one.

Avatar

Level 2

okay just kidding this actual did work.  it just took some time to instantiated the property in audience library.