GithubHelp home page GithubHelp logo

fdmediagroep / tag-manager Goto Github PK

View Code? Open in Web Editor NEW
1.0 5.0 0.0 3.65 MB

FDMG Tag Manager

Home Page: https://fd.nl

JavaScript 0.45% SCSS 5.13% TypeScript 90.14% Dockerfile 4.28%
nextjs tag-manager typescript s3-bucket s3-storage cloudfront css-modules javascript

tag-manager's Introduction

Build CodeQL

tag-manager

FDMG Tag Manager is a GUI for managing various JavaScript snippets which are concatenated to a single .js file and uploaded to an S3 bucket.

Getting started

Pre-requisites

  • NodeJS

Install dependencies

  1. npm i - install dependencies

Development

  1. npm run dev - Start the app locally on localhost:3000

Run production build locally

  1. npm run build - Optimized production build

  2. npm run start - Start the app locally on localhost:3000

States

Active: Tag is active and can run when the generated .js file is included on the a page.

Preview: Tag is in preview and can only run when the URL Query Parameter ?preview=1 exists.

Disabled: Tag is disabled and is also omitted from the generated .js file.

Timing

  • immediate: Snippet will be executed as soon as it has been parsed.

  • DOMContentLoaded: Snippet will execute when the browser fires this event.

  • load: Snippet will execute when the browser fires this event.

  • readystatechange: Snippet will execute when the browser fires this event.

  • beforeunload: Snippet will execute when the browser fires this event.

  • unload: Snippet will execute when the browser fires this event.

URL matching

Each tag can also set it's own URL matching RegExp. This allows for more control over on which url(s) a tag is allowed to run.

Environment variables

In order to store/load the tags/.js the FDMG Tag Manager requires a few environment variables to be setup. When running the app locally you can put these environment variables in a .env file in the root folder of the project:

PROD_AWS_ACCESS_KEY_ID: Self-explanatory

PROD_AWS_DEFAULT_REGION: Self-explanatory

PROD_AWS_SECRET_ACCESS_KEY: Self-explanatory

PROD_BUCKET: Self-explanatory

PROD_CDN_DISTRIBUTION_ID: Self-explanatory

BASIC_AUTH_USER: For maximum security it is recommended to run this application locally only.

BASIC_AUTH_PASS: For maximum security it is recommended to run this application locally only.

S3_LOCATION: Sub-bucket location within the S3 Bucket

You see a prefix of PROD_ in front of the AWS environment variable names. This is done in case of when we want to support multiple environments from a single FDMG Tag Manager instance.

tag-manager's People

Contributors

dependabot[bot] avatar willemliu avatar willemliufdmg avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

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.