Implement Google AnalyticsScript in our code pen portfolio?


In order for me to get actual data about my codepen I was wondering if I could include the Google Analytics tracking code? (I have a domain name dying to receive a real website :slight_smile: so until then, I could use the GA script to get data about my project.

Has anyone done that before? Is it ok to do it?

I’m not sure if it would work, but there is only one way to find out! If it did work, it might give you a few extra insights other than what codepen already provides.

i was more worried about the codepen policy . it is possible to do it. if it works out I will post a tutorial for those who want to do it.


You could also run your pen (debug URL) through PageSpeed Insights.

Thanks, but done already, forgot to mention it :slight_smile: At least I think we are talking about the same tool.

By the way now that you are mentioning it, the javascript belonging to codepen seems to slow things down.
Do you think it’s that significant?
And while we are mentioning this:
Do you know what that means:

"Eliminate render-blocking JavaScript and CSS in above-the-fold content"
I quoted that from the report.

As an experiment, added HTML async attribute (<script async src="my.js">) to all external scripts on my portfolio page. Results changed from top to bottom set of scores.

Nice! Thanks for the feedback


I set up a new property in my Google Analytics account and implemented the tracking code in both my pens, we will see what happens :wink: