https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
c

clean-city-48510

11/08/2023, 10:25 PM
2. Is it possible in GrowthBook to target experiments based on dataLayer variables that exist before GrowthBook is loaded?
f

fresh-football-47124

11/08/2023, 10:39 PM
yes, the attributes you use for targeting are completely customizable
the data evaluations are done on the SDK, and any data you set can be used
c

clean-city-48510

11/08/2023, 10:43 PM
👍
Should I pass dataLayer variables on which I want to target to GrowthBook as attributes during initialization GB like
Copy code
attributes: {
    clientId: clientId,
    userId: userId,
    country: "US",
    variables from dataLayer
  }
or GrowthBook recognise dataLayer automatically and can use these variables for targeting?
f

fresh-football-47124

11/10/2023, 9:00 PM
How it works on the data side, is that we pull the assignment information and then join it to all the other information, based on the randomization unit (typically a user or anon id). you can pass that info if you like, but its not required - and it might already be there in the exposure event
3 Views