analytics.js-integrations icon indicating copy to clipboard operation
analytics.js-integrations copied to clipboard

Added queueName option for custom dataLayer

Open ccook10-chwy opened this issue 2 years ago • 2 comments

What does this PR do? Google Tag Manager supports custom queue (dataLayer) name but the existing integration does not allow for this. This change adds a queueName option to the GTM integration to support this.

Are there breaking changes in this PR? No. This change adds an optional option which defaults to dataLayer so that it will continue to function as prior to the change.

Testing Testing completed successfully. Unit tests were updated to test the new queueName option.

Any background context you want to provide? This change is needed to aid migration from on-site GTM to Segment destination for large or complex websites which cannot implement the migration all at once. Without this change, a GTM destination cannot be added to a Segment source without breaking an existing GTM implementation.

Is there parity with the server-side/android/iOS integration components (if applicable)? No

Does this require a new integration setting? If so, please explain how the new setting works Yes.

  • DataLayer
  • You can specify a custom name for your dataLayer variable if you need to (e.g., coexist with an existing GTM implementation). The name must contain only letters, numbers, underscore, or dollar sign to meet JavaScript identifier rules.

Links to helpful docs and other external resources

ccook10-chwy avatar May 18 '23 02:05 ccook10-chwy