Skip to content

Commit 7e2dc18

Browse files
committed
Move into try block
1 parent c5f08c3 commit 7e2dc18

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/roktManager.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,6 @@ export default class RoktManager {
122122
}
123123

124124
public selectPlacements(options: IRoktSelectPlacementsOptions): Promise<IRoktSelection> {
125-
if (this.experimentAllocation) {
126-
options.attributes['rokt.experimentid'] = this.experimentAllocation.experimentId;
127-
options.attributes['rokt.bucketid'] = this.experimentAllocation.bucketId;
128-
options.attributes['rokt.userid'] = this.experimentAllocation.userId;
129-
}
130125

131126
if (!this.isReady()) {
132127
this.queueMessage({
@@ -143,6 +138,12 @@ export default class RoktManager {
143138

144139
this.setUserAttributes(mappedAttributes);
145140

141+
if (this.experimentAllocation) {
142+
mappedAttributes['rokt.experimentid'] = this.experimentAllocation.experimentId;
143+
mappedAttributes['rokt.bucketid'] = this.experimentAllocation.bucketId;
144+
mappedAttributes['rokt.userid'] = this.experimentAllocation.userId;
145+
}
146+
146147
const enrichedAttributes = {
147148
...mappedAttributes,
148149
...(sandboxValue !== null ? { sandbox: sandboxValue } : {}),

0 commit comments

Comments
 (0)