Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Redirect url feature works incorrect #2414

Open
kholiavkoi opened this issue Apr 19, 2024 · 4 comments
Open

[Bug] Redirect url feature works incorrect #2414

kholiavkoi opened this issue Apr 19, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@kholiavkoi
Copy link

Summary

The result of redirect url feature is not 50/50, actually it is about 70/30

Expected Behavior

Must be 50/50

Current Behavior

Result is 70/30

@kholiavkoi kholiavkoi added the bug Something isn't working label Apr 19, 2024
@kholiavkoi kholiavkoi changed the title Redirect url feature works incorrect [Bug] Redirect url feature works incorrect Apr 19, 2024
@jdorn
Copy link
Member

jdorn commented Apr 19, 2024

Are you using Google Analytics 4 for event tracking or something else? And are you using the HTML Script Tag SDK or something else?

One of the common issues with redirects are that the page redirects before the tracking event can fire. So what is likely happening is that it IS splitting traffic 50/50, but a lot of the tracking calls to record the variation are being skipped, so it looks unbalanced when you look at results.

We have a navigateDelay setting that defaults to 100ms. if your event tracking library takes longer than that, you may need to increase this delay.

@kholiavkoi
Copy link
Author

kholiavkoi commented Apr 22, 2024

Here is more detailed info how i add scripts, i use webflow for creating website

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-000"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  
  gtag('config', 'G-000', {
    server_container_url : 'https://example.com/metrics',
  });
</script>

<script async
  data-api-host="https://cdn.growthbook.io/"
  data-client-key="sdk-000"
  src="https://cdn.jsdelivr.net/npm/@growthbook/growthbook/dist/bundles/auto.min.js"
></script>

<script>
	window.growthbook_config = window.growthbook_config || {};
  window.growthbook_config.trackingCallback = (experiment, result) => {
    console.log(experiment, result)
   
    gtag('event', 'experiment_id', {
      experiment_id: experiment.key + ":" + result.key,
      gbuuid: result.hashValue,
    });
	};
  
  window.growthbook_config.navigateDelay = 300
	window.growthbook_config.antiFlicker = true
  window.growthbook_config.antiFlickerTimeout = 800
 
 	window.onload = function() {
    document.getElementById('preloader').style.display = 'none';
  };
</script>

@JohanFactory
Copy link

JohanFactory commented Apr 22, 2024

Hey there,

We have the same problem, I was wondering why this difference...

Used the Shopify SDK method and documentation, with GA4.
Simple URL redirect experiment shows this 70/30 issue.

EDIT : well, just noticed the GB js was far before the GA4 js, I changed GB position, let's see.

@kholiavkoi
Copy link
Author

@jdorn do i have to increase navigateDelay? for how long? or are there any problems in my code above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants