Last active
October 1, 2020 16:27
-
-
Save h4de5/87182f8e9363b5a86566afd7479a274f to your computer and use it in GitHub Desktop.
Synology Photostation add Google Analytics to shared album
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// beware -- this will make you photostation less secure -- beware | |
// file: /volume1/\@appstore/PhotoStation/photo/cms/content_security_policy.php | |
// starting with Photostation 7 (PHP7) the new file to edit is: | |
// file: /volume1/\@appstore/PhotoStation/photo/include/content_security_policy.php | |
// rest is the same | |
// search for script-src | |
// add 'unsafe-inline' | |
// search for style-src | |
// add 'unsafe-inline' | |
// search for https://*.google.com | |
// add https://*.googletagmanager.com | |
// should look like this: | |
$rule .=" script-src 'self' 'unsafe-eval' 'unsafe-inline' https://*.synology.com https://*.google.com https://*.googletagmanager.com https://*.googleapis.com https://dme0ih8comzn4.cloudfront.net/js/feather.js feather.aviary.com http://featherservices.aviary.com *.google-analytics.com https://dme0ih8comzn4.cloudfront.net ;"; | |
$rule .=" style-src 'self' 'unsafe-eval' 'unsafe-inline' https://*.googleapis.com http://feather.aviary.com https://dme0ih8comzn4.cloudfront.net;"; |
updated javascript to track clicks on images as analytic events correctly.
also fixed comments.
changed comment style for easier vi pasting ..
fixed issues with single quotes in album names..
now works with updated google analytics and googletagmanager
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wonderfull . thx!