CollectionBuilder / collectionbuilder-csv

CollectionBuilder-CSV is a "stand alone" template for creating digital collection and exhibit websites using Jekyll and a metadata CSV.
MIT License
21 stars 16 forks source link

How to check if analytics were build properly? #32

Closed pvperez1 closed 2 years ago

pvperez1 commented 2 years ago

I have uncommented the google-analytics-id: G-xxxxxx, but upon checking thru tag assistant legacy google chrome extension, the analytics header seemed not to be added in the head section.

There is an instruction in the _config.yml that says: # BUILD SETTINGS # Note: use environment variable on build command to include analytics # JEKYLL_ENV=production jekyll build # (this is done automatically by gh-pages build)

I am using collectionbuilder-csv on onrender.com, do I need to add anything in the build command? Thanks!

image
evanwill commented 2 years ago

@pvperez1 it needs to be set to JEKYLL_ENV=production during build (which isn't automatic with jekyll build command alone), otherwise the analytics and page meta markup are skipped--so with your current build command, as you have found, the analytics aren't there because they are being skipped!

onrender you will have to update your build command to:

JEKYLL_ENV="production" bundle exec jekyll build

The other option is to use the command rake deploy, which is just a shortcut to the command above that we added to CB-csv--but I am not entirely sure if it works on Render or not.

@dcnb have you tried using rake deploy on render? And could you update your cb-docs deploy page to mention production build option?

pvperez1 commented 2 years ago

Thanks @evanwill! I updated my onrender build command and it worked