https://www.growthbook.io/ logo
#announcements
Title
# announcements
r

red-mouse-1009

02/25/2023, 6:35 AM
Hi , I am firing some growthbook events to Google Analytics . But when I look at the event counts of viewed_experiment it doesn’t get matched with the count of first time users that have visited my page . Any possible reason why that has happened?
Any possible reasons why that has happened?
@fresh-football-47124
Also please note my landing page has a huge number of user visits. So any possibility growthbook end point doesn’t get fired for every users @fresh-football-47124
f

fresh-football-47124

02/25/2023, 7:32 AM
it will get fired for every user included in the experiment
so its possible, depending on the targeting rules, and how you have the SDK implemented, that people won’t be included
r

red-mouse-1009

02/25/2023, 7:33 AM
I am having 100 percent rollout for every user
f

fresh-football-47124

02/25/2023, 7:34 AM
are you using GA UA or GA4?
r

red-mouse-1009

02/25/2023, 7:34 AM
I am using ga4
f

fresh-football-47124

02/25/2023, 7:34 AM
which count is higher?
r

red-mouse-1009

02/25/2023, 7:35 AM
Also I have multiple analytics tool integrated , same issue I can find there also . Number of first time users and growthbook event doesn’t match
Page visits are higher
f

fresh-football-47124

02/25/2023, 7:35 AM
higher in GrowthBook or GA?
r

red-mouse-1009

02/25/2023, 7:35 AM
Higher in ga
f

fresh-football-47124

02/25/2023, 7:36 AM
we unique the users - is it possible that GA is showing the total count, rather than the unique users?
r

red-mouse-1009

02/25/2023, 7:36 AM
No I have verified that
Landing page first time user visits is 1400 and viewed experiment has been fired only 500 times
f

fresh-football-47124

02/25/2023, 7:38 AM
what SDK are you using?
r

red-mouse-1009

02/25/2023, 7:40 AM
Even for today the page visit with first time user is 144 and my viewed experiment is fired only 83 times
@fresh-football-47124
Or maybe can you show me how to implement this in vanilla js or jquery
f

fresh-football-47124

02/25/2023, 7:53 AM
can you share the implementation?
what SDK are you using? JS I assume?
r

red-mouse-1009

02/25/2023, 7:54 AM
Yes sure
Yes js
This is the implement @fresh-football-47124
I believe this is how you used to implement in the past until the new doc arrived recently @fresh-football-47124
f

fresh-football-47124

02/25/2023, 8:06 AM
whats is in allCookies?
r

red-mouse-1009

02/25/2023, 8:07 AM
It’s the document.cookie
f

fresh-football-47124

02/25/2023, 8:07 AM
yes, I know
r

red-mouse-1009

02/25/2023, 8:07 AM
Basically that’s what we give as a unique id
Do you need more clarification?
@fresh-football-47124
f

fresh-football-47124

02/25/2023, 8:33 AM
yes
console log the allCookies
and share an example of it
r

red-mouse-1009

02/25/2023, 8:33 AM
Yes 👍
'_ga=GA1.1.1932450355.1666161180; _clck=17w80n9|1|f5u|0; _ga_9Z1Y32SCLZ=GS1.1.1666162410.1.1.1666163696.0.0.0; _ga_5BXQ7Z8VR4=GS1.1.1666162410.1.1.1666163696.0.0.0; _gcl_au=1.1.1442996401.1673413547; _ga_RDY711C2V5=GS1.1.1675752341.2.1.1675753746.0.0.0; mp_6eeaf384a1dc072fa42fe5195a4ecdab_mixpanel=%7B%22distinct_id%22%3A%20%227075767%22%2C%22%24device_id%22%3A%20%221863a7fbc234d-002b5b8ed4b0dc-11462c6d-1fa400-1863a7fbc24105%22%2C%22%24initial_referrer%22%3A%20%22%24direct%22%2C%22%24initial_referring_domain%22%3A%20%22%24direct%22%2C%22%24user_id%22%3A%20%227075767%22%2C%22app_platform%22%3A%20%22web%22%2C%22gold_user%22%3A%20true%2C%22language%22%3A%20%22ml%22%2C%22pro_user%22%3A%20true%2C%22phone_number%22%3A%20%22%2B919847170511%22%2C%22user_id%22%3A%207075767%2C%22free_trial%22%3A%20false%2C%22test_bucket%22%3A%20%22skilling_home_screen%22%2C%22new_user%22%3A%20false%2C%22lead_score%22%3A%202060%2C%22course_vertical%22%3A%20%22Skills%22%7D; _gid=GA1.1.1060008282.1677307767; _ga_0ZC25J7WK3=GS1.1.1677307767.4.1.1677307767.0.0.0; moe_uuid=4c413d9e-9348-44c0-b9f7-e00bff847346; _ga_SPG65LH67L=GS1.1.1677314128.2.1.1677314159.0.0.0'
It looks like this @fresh-football-47124
It’s different for each users
f

fresh-football-47124

02/25/2023, 8:54 AM
ya… that’s not really how you should be using it
you want to make sure it doesn’t change for the same user, and with that many variables, I’m guessing it will - which may cause double exposures
double exposures are filtered out
r

red-mouse-1009

02/25/2023, 8:57 AM
But the first user visit is around 1400 so that technically means 1400 times viewed experiment should also be fired right ?
@fresh-football-47124
f

fresh-football-47124

02/25/2023, 8:58 AM
yes
you can query the db directly to see how many raw events were fired
the numbers in GrowthBook will be filtered by date, filter out multiple exposed users, etc.
r

red-mouse-1009

02/25/2023, 8:59 AM
We did the same and it was noted that for some users the experiment was not fired
And for some users it was fired
@fresh-football-47124 does it have something to do with the new implementation methods that you have provided in you docs
f

fresh-football-47124

02/25/2023, 9:05 AM
we just gave some examples- but the fundamentals of how the SDK works has not changed.
first step is to add some more debugging on the failure modes - you’re console.log’ing them, but you won’t see
second - change that allCookies thing to just store the user_id
and use that ID also for GrowthBook
r

red-mouse-1009

02/25/2023, 9:11 AM
The problem is that we are not able to find when exactly does the reading doesn’t happen . Not able to figure that out yet .
Also this is a public landing page . And we don’t have a user id since we have an anonymous visitors
f

fresh-football-47124

02/25/2023, 9:13 AM
you can make one
and store it in a cookie or localstorage
I’m guessing its the allCookies
if that is null
users won’t be bucketed
so there will be a race condition there for new users
r

red-mouse-1009

02/25/2023, 9:51 AM
@fresh-football-47124 but don’t you think there is no chance the cookie will return a null value
13 Views