Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Link google analytics or google tag manager from grapesjs settings

License

NotificationsYou must be signed in to change notification settings

Ju99ernaut/grapesjs-ga

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Easily link to your google analytics or google tag manager

DEMO

HTML

<linkhref="https://unpkg.com/grapesjs/dist/css/grapes.min.css"rel="stylesheet"><scriptsrc="https://unpkg.com/grapesjs"></script><scriptsrc="https://unpkg.com/grapesjs-ga"></script><divid="gjs"></div>

JS

consteditor=grapesjs.init({container:'#gjs',height:'100%',fromElement:true,storageManager:false,plugins:['grapesjs-ga'],});

CSS

body,html {margin:0;height:100%;}

Summary

  • Plugin name:grapesjs-ga
  • Components
    • gtm
    • ga
  • Blocks
    • gtm-block
    • ga-block

Options

OptionDescriptionDefault
gtmIdvalue from google tag manager dashboard
gtmLabellabel for google tag manager blockTag Manager
gtmCategorycategory for google tag manager blockGoogle
gtmBlockoptions to extend google tag manager block{}
gtmComponentoptions to extend google tag manager component model{}
gaIdvalue from google analytics dashboard
gaLabellabel for google analytics blockAnalytics
gaCategorycategory for google analytics blockGoogle
gaBlockoptions to extend google analytics block{}
gaComponentoptions to extend google analytics component model{}

Download

  • CDN
    • https://unpkg.com/grapesjs-ga
  • NPM
    • npm i grapesjs-ga
  • GIT
    • git clone https://github.com/ju99ernaut/grapesjs-ga.git

Usage

Directly in the browser

<linkhref="https://unpkg.com/grapesjs/dist/css/grapes.min.css"rel="stylesheet"/><scriptsrc="https://unpkg.com/grapesjs"></script><scriptsrc="path/to/grapesjs-ga.min.js"></script><divid="gjs"></div><scripttype="text/javascript">vareditor=grapesjs.init({container:'#gjs',// ...plugins:['grapesjs-ga'],pluginsOpts:{'grapesjs-ga':{/* options */}}});</script>

Modern javascript

importgrapesjsfrom'grapesjs';importpluginfrom'grapesjs-ga';import'grapesjs/dist/css/grapes.min.css';consteditor=grapesjs.init({container :'#gjs',// ...plugins:[plugin],pluginsOpts:{[plugin]:{/* options */}}// orplugins:[editor=>plugin(editor,{/* options */}),],});

Development

Clone the repository

$ git clone https://github.com/ju99ernaut/grapesjs-ga.git$cd grapesjs-ga

Install dependencies

$ npm i

Start the dev server

$ npm start

Build the source

$ npm run build

License

MIT

About

Link google analytics or google tag manager from grapesjs settings

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp