Skip to content

Conversation

scysys
Copy link
Contributor

@scysys scysys commented Oct 2, 2018

Add LiveZilla Tag

Tested and working.
Using it a few days on own Websites.

I think it has all options that are needed.

@Findus23 Findus23 added the New Tag Adding a new Tag label Oct 2, 2018
Copy link
Collaborator

@Findus23 Findus23 left a comment

Choose a reason for hiding this comment

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

Hi,

many thanks for creating a new Tag.

I have a few comments below (keep in mind that I don't know LiveZilla)

Please also fix the indention as it seems to be a bit off in a few lines.

// return parent::getIcon();
//
// The image should have ideally a resolution of about 64x64 pixels.
return 'plugins/TagManager/images/icons/livezilla_icon.png';
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wanted to complain about the ugly icon, but it seems like you took the best they have
🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I try to find another Image, but im failed :(

}),
$this->makeSetting('LivezillaDynamicDomain', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
$field->title = 'Livezilla Domain';
$field->description = 'Enter your Domain without http:// or https://';
Copy link
Collaborator

Choose a reason for hiding this comment

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

While obviously everyone should be using https, it is a bit counter intuitive that https is hardcoded.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Livezilla is an Chat and Monitoring solution. Thoose things violates privacy of an website visitor. I do not tolerate those implementations over an insecure http connection!

Copy link
Collaborator

Choose a reason for hiding this comment

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

I fully agree, then you should make it clear to the user (e.g. make them enter the URL and throw an error if it isn't HTTPS).

If you want to I can help you write this validate function.

$field->description = 'In most cases it should be the Standard. (true)
Available options are: true or false'; // Howto linebreak?
$field->validators[] = new NotEmpty();
$field->validators[] = new CharacterLength(4, 5);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use a Checkbox for boolean settings instead of saving a string.

See here for an example:

$this->makeSetting('raygunEnablePulse', false, FieldConfig::TYPE_BOOL, function (FieldConfig $field) {
$field->title = 'Enable Pulse (Real User Monitoring)';
$field->uiControl = FieldConfig::UI_CONTROL_CHECKBOX;
$field->description = 'Automatically identify front end performance issues causing slow page load speeds. See what your users see in the browser and discover why users had poor quality experiences.';
})

$field->validators[] = new NotEmpty();
$field->validators[] = new CharacterLength(4, 5);
}),
$this->makeSetting('LivezillaDynamicCookieLawName', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the cookie feature makes this tag unnecessarily complicated and hard to understand.
@tsteur What do you think about adding a cookie feature (trigger?) to MTM?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I using it with an other implantation for the tag-manager. It respect the Privacy of European Users and load this Tag only when he really accept those parts on an website.

The tag-manager gives me no real way to document this for other users.

if (document.cookie.indexOf('' + LivezillaDynamicCookieLawName + '=' + LivezillaDynamicCookieLawValue + '') > -1 ) {
var s1 = document.createElement("script"), s0 = document.getElementsByTagName("script")[0];
s1.type = 'text/javascript';
s1.defer = LivezillaDynamicDefer;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is the reason you never store boolean values as a string.
Even in Javascript "false" is true/truthy which means that if a user had entered "false" into the settings it would still be deferred.
Because this returns this is truthy

if ("false") {
    console.log("this is truthy")
} else {
    console.log("this is falsey")
}

lang/de.json Outdated
@@ -278,6 +278,9 @@
"LastUpdated": "Zuletzt aktualisiert",
"LastVersions": "Letzte Versionen",
"LearnMore": "Mehr dazu",
"LivezillaDynamicTagName": "Livezilla Chat / Monitoring",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translations are managed via transifex, so please don't modify them here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did not knew that.

$field->validators[] = new NotEmpty();
$field->validators[] = new CharacterLength(32);
}),
$this->makeSetting('LivezillaDynamicDomain', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not quite sure but could this be maybe automatically configured in the JavaScript depending on the current domain? eg var LivezilleDomain = localhost.origin or so?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@tsteur I am not sure, but as I understood it this is the URL where Livezilla is installed (so similar to the Matomo URL)

Copy link
Member

Choose a reason for hiding this comment

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

I see. Makes sense 👍

Copy link
Collaborator

@Findus23 Findus23 left a comment

Choose a reason for hiding this comment

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

Appart from the question on how to best handle opt-out/opt-in cookies, this looks good to me now.

@tsteur, can you please take a closer look.

$this->makeSetting('LivezillaDynamicDefer', true, FieldConfig::TYPE_BOOL, function (FieldConfig $field) {
$field->title = 'Livezilla Script "defer"?';
$field->uiControl = FieldConfig::UI_CONTROL_CHECKBOX;
$field->description = 'In most cases you should let it activated.';
Copy link
Member

Choose a reason for hiding this comment

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

If possible, be good to give an example when it makes sense to disable it. Not needed though.

Copy link
Contributor Author

@scysys scysys Oct 5, 2018

Choose a reason for hiding this comment

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

No its really not needed. But sometimes you have sites where you would remove this part. So there are 2 Options. Remove "defer" completely or leave it as default and give an user no options to remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

An really better solution would be an general option in Tag Manager to async or defer scripts. I don't find those options at this moment.

Example from Qubit´s OpenTag Manager
bildschirmfoto 2018-10-05 um 13 51 28

@tsteur
Copy link
Member

tsteur commented Oct 4, 2018

@scysys @Findus23 looks good to me. I would only replace all tabs with spaces and sometimes it looks like there are two many tabs/spaces.

@tsteur
Copy link
Member

tsteur commented Oct 4, 2018

Tested it and worked fine for me.

Copy link
Member

@tsteur tsteur left a comment

Choose a reason for hiding this comment

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

Cheers 👍 I'll merge soon

@tsteur tsteur merged commit 807883a into matomo-org:master Nov 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review New Tag Adding a new Tag
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants