How to modify device tenancy tags without breaking CPF logic?

Firstly, CPF is epic.

So when [bulk] creating devices on the ‘back end’ (not using the app’s Device > Register Device menu), if I manually assign Customer, Site tags here to match the queries in “Users and Groups” for multi-tenancy - does that break the cpf_group tag / logic that comes w/ CPF?

Or more elegantly, how to use something like customer1-site1 format for the cpf_group tag (vs a random string)?

In pics,
How to assign/modify this tag -

Used on the app side -

To maintain this logic?

The CPF uses the ID of the Experience Group (instead of its name) to associate devices to groups. This is done to allow multiple groups with the same name.

Let’s first look at the Experience Group configuration:

Your IDs will be different, but the group includes all devices with the cpf_group tag set to the group’s own ID. You can then inspect a device and see that the tag’s value also matches the ID of the desired experience group.

To then assign devices to a group that is compatible with the CPF, you can perform a bulk update on the newly created devices and set the cpf_group tag to the ID of the Site (Experience Group) you’d like to assign them to.

Ok cool, so is that like {{experience.groupId}} or something to dynamically reference (grab and set)?

Guess that’s happening without the handlebars in the func node here?
a js reference on line 39 (return t.key === tagName;)

If you’re looking for where a user’s devices are queried, that’s in the cpf-element-devices-table workflow in the Build Query Function Node.

The CPF uses Losant’s built-in ability to query devices by Experience User. Behind the scenes, this queries all devices that are associated to group that a user is assigned to (or any child groups).

Here’s the relevant section in that function node:

and.push({
    "experienceUserId": {
        "$eq": payload.experience.user.id
    }
});

The function is then appending any other filters the user may have provided in the devices table.

The cpf-page-device-details workflow is only looking at the details of a single device. It’s primarily using a Device: Verify Node to check that the user is associated with the device, which means the device is associated to the group in which the user belongs or any child groups.