Is there a way growthbook to send custom attribut...
# ask-questions
q
Is there a way growthbook to send custom attributes like user_id to GA4 datalayer? We could not find a way how to attach internal "user_id" to growthbook experiment_view entry in GA4 https://docs.growthbook.io/lib/script-tag
f
Hi Marton, I understand you want to add user_id as a custom attribute. Here is an example:
Copy code
<script>
window.growthbook_config = window.growthbook_config || {};
window.growthbook_config.attributes = {
    user_id: "xyz",
    otherCustomAttribute: 12,
}
</script>
You'll want to add this before the other GrowthBook code. Learn more in the docs: https://docs.growthbook.io/lib/script-tag#adding-custom-attributes