This is a cross post from https://stackoverflow.com/questions/40544132/google-analytics-experiments-with-ajax. I though it is better to dicuss it here.
I would like to integrate google analytics experiments to our website.
My situation: We have a solution for feature toggles, that also allows A/B testing. The features are stored in the database and have a percentage that defines how many users will see the feature. We also store the features in a cookie, so the users will see the same view when he refreshs the page.
I see 3 options:
- Track all experiments, even if they are not used on this site. (I think it does not make a lot of sense)
- Make a tool/configuration to define the experiments and feature toggles that are used on each site (very easy to make mistakes here).
- Track the experiments from server-side code (but I don't know how GA will connect these calls to a page view).
What is the official guideline for ajax requests and google analytics experiments?