Giter VIP home page Giter VIP logo

braze-gtm-initialization's People

Contributors

davidbielik avatar spvismaya avatar wesleyorbin avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

minishlink

braze-gtm-initialization's Issues

Add "Enable Tracking" option

Hello,

To be GDPR compliant, you would need to load the Braze SDK only after it has been consented. Take the following user flow:

  • user goes to the page
  • Braze is not loaded as per GDPR
  • user accepts cookies
  • Braze is loaded and Braze.initialize() is called through this GTM tag
  • user then refuses cookies
  • Braze.disableSDK() is called through the GTM action tag
  • user reloads the page
  • Braze is not loaded as per GDPR
  • user then re-accepts cookies
  • Braze.initialize() is called though this GTM tag but the user still has the "disable cookie" present, so Braze skips all activity

In this case, we would need to call enableSDK after Braze has been loaded, but before Braze.initialize()

You can probably workaround this by duplicating the initialization tag and user tag sequencing + the GTM action tag with enable SDK but that would open two sessions in a row, or maybe not, I don't know Braze internals and I don't really want to know.

I basically modified the template with

  if (data.disableTracking) {
    const disableSdkName = majorVersion >= 4 ? 'disableSDK' : 'stopWebTracking';
    callInWindow(sdkObject + '.' + disableSdkName);
  } else {
    if (data.enableTracking) {
      const enableSdkName = majorVersion >= 4 ? 'enableSDK' : 'resumeWebTracking';
      callInWindow(sdkObject + '.' + enableSdkName);
    }

    // Initialize the SDK with api key and base url (from user input)
    callInWindow(sdkObject + '.initialize', data.apiKey, options);

This is not really an issue for 99% of the users, but for non technical people of a product team this can get confusing that it doesn't work

Template review feedback

Thanks for submitting a template to the gallery, there were a few issues in your template that needed to be resolved ahead of approving the template for the gallery.

  1. encodeUriComponent should be used on user provided values that are then used as parameters in your url. These methods take in a single text argument and return a URI Encoded string. You should use this method on "data.sdkVersion" when generating the url
    const url = 'https://js.appboycdn.com/web-sdk/'+ data.sdkVersion +'/appboy.min.js';
  2. The readme.md doesn't provide any information. Instead it redirects user to the gallery page which is irrelevant. Please provide valid information if any about the template.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.