Conversation
The module setting will fallback to `site_html_header` as that was the name before. While at it I fixed the labels as they used hardcoded text or displayed faulty output.
The module setting will fallback to `site_html_footer` as that was the name before. While at it I fixed the labels as they used hardcoded text or displayed faulty output.
It seems like this settings was already available but not displayed in the backend :s
Sorry, I copy/pasted it wrong.
I think I wrote it more readable: * If Google Tag Manager is added thru the backend we expect Google Analytics to be loaded from within Google Tag Manager * If the web property is empty we can't build a correct code therefore it should not be added * If the web property is present in any of the site wide HTML than we should not add it.
gtag.js is 8000 the current way to add Google Analytics to a site. See https://support.google.com/analytics/answer/7538414
…Manager Container Id
The Analytics module should not be responsible for adding the Google Analytics Tracking Code. As we now have a separate setting we use that one to decide if the code should be added.
It should be as easy as:
$container->get(ForkCMS\Google\TagManager\DataLayer::class)->add('key', $value);
We will add the anonimizeIp variable by default
|
@tijsverkoyen Would it make sense to deprecate the analytics module in Fork after this PR is merged since the whole setup has moved somewhere else? it shows some graphs but google analytics shows them better and you can do more with it. |
|
I think the integrated analytics module has it value for a lot of people who are not that experienced in Google Analytics. On the other hand it would mean that there is a lot of code not to be maintained anymore. |
|
We (webleads) never load Google Analytics directly. So I would say, remove the GA code from ForkCMS. |
|
I think removing GA could be ok. But for the time being add both to Fork until version 6.0. If you remove GA a good manual should be available on how to add GA in combination with GTM. Somewhere else I noticed a discussion about the graphs in Fork, if these should stay or be removed. At first I thought remove them from Fork. A week ago the api or something had an error this resulted in a 500 error, and users where unable to login. But on the other hand users look at these graphs since GA is sometimes to complicated. If users get more used to GA they prefer this above the Fork stats. |
|
I think there are several questions to be answered: 1. Should we remove the Analytics module. 2. Should we provide the option to choose between Google Analytics and Google Tag Manager
3. Some question about the removal of graphs My personal opinion: 1: I think the current Analytics has value for non-professional users or users that only need basic stats. At this moment I would vote against removing the module. |
|
I would keep all three options as well. I find the arguments of @tijsverkoyen convincing. |
|
@carakas For this PR there is no work left. For #3048 I need to review the comments again and check to finish up the code, I will try to finish it this month. Let me know if you merge these PR's, in that case I will create a blogpost based on the PR descriptions, so we can use it as a reference/docs for these features. |
|
|
||
| // assign site wide html | ||
| $this->template->assignGlobal('siteHTMLFooter', $siteHTMLFooter); |
There was a problem hiding this comment.
for now I would assign it to the both of them for BC reasons. There are people that upgrade to the latest version of fork and this will break the theme that they use
| $this->get('fork.cookie') | ||
| ); | ||
| $siteHTMLHeader .= "\n" . $this->jsData; | ||
| $this->template->assignGlobal('siteHTMLHeader', trim($siteHTMLHeader)); |
There was a problem hiding this comment.
for now I would assign it to the both of them for BC reasons. There are people that upgrade to the latest version of fork and this will break the theme that they use
| ); | ||
| $this->get('fork.settings')->set( | ||
| 'Core', | ||
| 'site_start_of_body_scripts', |
There was a problem hiding this comment.
I would write to the old one as well with a deprecation notice for BC reasons. There are people that upgrade to the latest version of fork and this might create issues if they use that setting somewhere
| ); | ||
| $this->get('fork.settings')->set( | ||
| 'Core', | ||
| 'site_html_footer', |
There was a problem hiding this comment.
I would write to the old one as well with a deprecation notice for BC reasons. There are people that upgrade to the latest version of fork and this might create issues if they use that setting somewhere
Type
Pull request description
New Google Analytics options
We removed automatically adding Google Analytics code if you link the Analytics
module. From now on you have two options to let Fork add Google tracking:
You can select them both, but that is not something I would recommend. In this case both the Google Analytics and Google Tag Manager code will be added.
Google Analytics
If you don't want to use Google Tag Manager you can just set the Tracking ID for Google Analytics. With this we will add the Google Analytics code directly.
Google Tag Manager
Google Tag Manager is a very powerful product from Google where you can manage
everything yourself, or allow external users access to manager the scripts
for you. With Google Tag Manager you don't need a Fork CMS developer to add
scripts for you.
If you want to add Google Tag Manager to your Fork CMS website you need to fill
in the Google Tag Manager Container Id in the Settings screen under Google Tag
Manager Container Id. You can find this Id by entering Google Tag Manager, in the
overview it is listed under Container ID.
anonymize IP
If you are targeting users in the EU, you have probably heard of GDPR. GDPR is all
about protecting the personal data of people.
Google has made it possible to anonimize the IP's that are send, so by default we
will anonimize them.1 If the user allows it we will not anonymize them anymore. At the moment this happens as they agree on the current Cookie Bar implementation.
To make this possible we need to configure a variable in Google Tag Manager:
1: In Belgium this is not enough, the Belgian DPA has said that anonimyzeIp is not
enough. So if you are a Belgian company you should ask the visitor permision before loading
Google Analytics.
Google Analytics
The next step is to add Google Analytics thru Google Tag Manager.
Configure a variable which contains the Tracking ID, this is optional but advised
Add the Universal Analytics
Don't forget to publish the changes.