Google Experiments Bundler

0.0.2 · abandoned · verified Tue Apr 21

This package, `ga-experiments-bundler`, was designed to pack multiple Google Analytics experiment JavaScript files (specifically `/www.google-analytics.com/cx/api.js?experiment=YOUR_EXPERIMENT_ID`) into a single bundle. Its purpose was to facilitate A/B testing through Google Analytics Content Experiments. However, Google Analytics Content Experiments were deprecated around January 2020, and its successor for web experimentation, Google Optimize (and Optimize 360), was officially sunset on September 30, 2023. As a result, this package relies on a completely defunct Google service and is no longer functional or relevant for modern A/B testing implementations. Current A/B testing strategies with Google Analytics 4 (GA4) involve integrating with third-party experimentation platforms. The package is at version 0.0.2, indicating it was an early-stage project with no active development or planned release cadence.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to use the `ga-experiments-bundler` API to attempt to bundle a list of Google Experiment IDs. This code will likely fail due to the deprecation of the underlying Google service.

const bundler = require('ga-experiments-bundler');
const fs = require('fs');

const experimentIds = [
    'nY2RGW2IQcWuvbYca51vhg',
    'ZWQgYW5kIHRyYW5zZmVyca',
    'UlNRSBjb250ZW50IHRyeHR'
];

bundler.bundle(experimentIds)
    .then(function(js){
        console.log('Successfully attempted to bundle experiments. Writing to cxapi.js...');
        fs.writeFileSync('cxapi.js', js);
        console.log('Bundle written. Note: The functionality of this bundle is defunct.');
    })
    .catch(function(error) {
        console.error('Failed to bundle Google Experiments. This is expected as Google Optimize and Content Experiments are defunct.', error.message);
    });

view raw JSON →