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

feat: Support setting for OneTrust auto-block prevention #52

Merged
merged 4 commits into from
Sep 26, 2024

Conversation

rmi22186
Copy link
Contributor

@rmi22186 rmi22186 commented Sep 23, 2024

Instructions

  1. PR target branch should be against development
  2. PR title name should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-title-check.yml
  3. PR branch prefix should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-branch-check-name.yml

Summary

Under certain circumstances, OneTrust will autoblock GTM from loading because it is a known tracker. Per OneTrust docs, this can be prevented by adding a data-ot-ignore attribute to the script tag.

Testing Plan

  • Was this tested locally? If not, explain why. -
  • We cannot add unit tests because when the kit runs the automated tests, the kit does not load the script for GTM which is where the new code lies, so I manually tested this. While I cannot get OneTrust to autoblock GTM when loading both (it seems to require some settings on OneTrust's UI), this PR follows the docs by adding the data-ot-ignore attribute, and does successfully add the attribute when viewing Elements in the inspector. See the screenshot below

image

  • {explain how this has been tested, and what, if any, additional testing should be done}

Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)

## [2.1.2](v2.1.1...v2.1.2) (2024-09-19)

### Bug Fixes

* Always send default consent payload (if available) before updating ([4c88305](4c88305))
@rmi22186 rmi22186 force-pushed the feat/SQDSDKS-6520-support-OT-auto-block branch from 4177a89 to 5a89bd7 Compare September 23, 2024 15:57

return true;
}

function loadSnippet(url, dataLayerName) {
function loadSnippet(url, dataLayerName, settings) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might come across as a nitpick, but I don't see any benefit passing in the entire settings object just for a single setting. Unless we start needing several settings in the function, I would just add preventAutoBlock in as an argument.

@rmi22186 rmi22186 changed the base branch from master to development September 26, 2024 15:58
@rmi22186 rmi22186 merged commit 687fcd2 into development Sep 26, 2024
3 checks passed
github-actions bot pushed a commit that referenced this pull request Sep 30, 2024
# [2.2.0](v2.1.2...v2.2.0) (2024-09-30)

### Features

* Support setting for OneTrust auto-block prevention ([#52](#52)) ([687fcd2](687fcd2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants