Tracking code for transferring of data of an unregistered user

Description

This method must be passed in order to pass information about a customer to the Retail Rocket system, for example, an email address that is not yet known to launch a system identifier in an online store.

Can be used on the subscription forms in the footer, on subscription pop-ups and etc.

Note: This method should not be used for unsubscribing previously subscribed users.

🚧

Parameters description

<email> - user' email address, optional parameter;

<phone> - User phone number in format E.164, optional parameter;

<defaultStockId> - Identifier of the stock (region), optional parameter;

<softLinks> - dictionary, pointer to the customer - a pair consisting of key-string and a value-string (for example, the key is "loyalty card", and the value is "number of loyalty card"), optional parameter;

<customData> - dictionary with string-key and string-value, additional parameters for customer, optional parameter;

<isAgreedToReceiveMarketingMail> - Subscription consent, default value is true

<mobilePushSubscription> - optional, object that contains information about the subscription to mobile push notifications. Contains another object inside, depending on the subscription type

Example of code

rrApi.setProfile({
    "email": "[email protected]",                    
    "phone": "09999999999",    
    "softLinks": [{name: "bonus card", value: "234234"}],
    "defaultStockId": "<stock identifier>",        
    "customData": {"data1": "value1"},
    "mobilePushSubscription" : {
       "fcmSubscription" : {
          "creationTimestamp" : "2025-03-31T11:03:02.3564674+03:00",
          "applicationId" : "applictionId",
      	  "fcmProjectId" : "my-awesome-fcm-project",
      	  "token" : "fcm-push-token"
        }
     },  
    "isAgreedToReceiveMarketingMail": true            
});

Mobile push notifications subscription object examples

"mobilePushSubscription" : {
    "fcmSubscription" : {
      "creationTimestamp" : "2025-03-31T11:03:02.3564674+03:00",
      "applicationId" : "applictionId",
      "fcmProjectId" : "my-awesome-fcm-project",
      "token" : "fcm-push-token"
    }
}
"mobilePushSubscription" : {
    "apnsSubscription" : {
      "isDevEnvironment" : false,
      "creationTimestamp" : "2024-06-25T18:09:19.4754466+03:00",
      "applicationId" : "applictionId",
      "token" : "apns-push-token"
    }
}
"mobilePushSubscription" : {
    "huaweiSubscription" : {
      "creationTimestamp" : "2024-05-14T23:17:57.5577110+03:00",
      "applicationId" : "applictionId",
      "token" : "huawei-push-token"
    }
 }