Skip to content

Johan initial template#1

Open
johanesteves wants to merge 2 commits into
masterfrom
johan-initial-template
Open

Johan initial template#1
johanesteves wants to merge 2 commits into
masterfrom
johan-initial-template

Conversation

@johanesteves

Copy link
Copy Markdown
Collaborator

Created initial template for Chartbeat's GTM Template using the instructions in the link below:

-https://developers.google.com/tag-manager/templates
-https://developers.google.com/tag-manager/templates/gallery

Comment thread template.tpl
]


___TESTS___

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can you add tests?

Comment thread template.tpl
]


___SANDBOXED_JS_FOR_WEB_TEMPLATE___

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We should have a FE person review the below to make sure it's idiomatic JS. Want to ping Dolores on it?

Comment thread template.tpl
},
{
"type": "CHECKBOX",
"name": "flickerControl",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I noticed that we have this flicker control variable but we're pulling in chartbeat.js, not chartbeat_mab.js...do we need chartbeat_mab to make this relevant?

Comment thread template.tpl
const queryPermission = require('queryPermission');
const createQueue = require('createQueue');
if (queryPermission('access_globals', 'readwrite', 'dataLayer')) {
const dataLayerPush = createQueue('dataLayer');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't think you are using this const

Comment thread template.tpl
// Enter your template code here.
const log = require('logToConsole');
const query = require('queryPermission');
const makeString = require('makeString');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

not using it!

Comment thread template.tpl
const injectScript = require('injectScript');
const setInWindow = require('setInWindow');
const copyFromWindow = require('copyFromWindow');
const queryPermission = require('queryPermission');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

const query and queryPermission are the same thing

Comment thread template.tpl
const domain = data.domain;
const sections = data.sections;
const authors = data.authors;
const flickerControl = data.flickerControl;

@Dquinonez Dquinonez Dec 4, 2020

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If you are not using these const other than to set the _sf_async_config later... I would say just use

_sf_async_config.uid = data.uid;
_sf_async_config.domain = data.domain; 
_sf_async_config.flickerControl = data.flickerControl;
_sf_async_config.sections = data.sections; 
_sf_async_config.authors = data.authors;

and delete these const

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