Closed (fixed)
Project:
Mautic Integration
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Nov 2019 at 21:39 UTC
Updated:
20 Aug 2020 at 07:01 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sk33lz commentedComment #3
jeremyr commentedThe Mautic docs suggest putting the script in the footer because it's a best practice, and often for performance reasons.
I suspect the reasoning for adding it to the header is because the tracking script is generated by the module, as opposed to being a static file. It's apparently not as simple to attach inline JS to the footer as one would think.
If it were a file it could be defined as a library and then added to the page differently. Has anyone seen a better way to accomplish this, or can provide a patch to move it?
Comment #4
dioni commentedHi,
I created a patch as 'first approach'. Having it as a js file is also easier to be disabled for other modules like eu_cookie_compliance.
Comment #5
dioni commentedComment #6
lukassykora commentedHi, I really like the patch, but it seems it does not provide the functionality that is desired in the title: 'Add setting to move snippet to footer region'. I could not find any setting (header or footer). Maybe it would need to extend the mautic.libraries.yml to something like:
And then add the right library based on the setting.
Comment #7
lukassykora commentedI added settings for header/footer and automated tests. Please, could you review?
Comment #8
dioni commentedHi lukassykora,
I have tested it and it works fine :) !
Comment #9
lukassykora commentedComment #10
lukassykora commented