Analytics, Google Tag Manager

Tracking Google Analytics Events in Squarespace

GA_SS

In the world of freelancers one does come up against massive walls of code that are really not made to work with one another. In setting up Google Analytics tracking on any site that is made in wordpress, Wix or Squarespace, one encounters all sorts of peculiarities.

I am going to talk of capturing events in Google Analytics from within the Squarespace environment.

First of all, the normal way to integrate Google Analytics in Squarespace is easy enough. Just do the following:

Config  — >  Settings  –> Advanced  –> External Services

and put the UA-XXXXXXX-Y number in there.

However, please note that this will conform to Google Analytics tracking that is several generations old.

This is just page view tracking though.


How does one add event tracking where a new page is not going to be called?


I am going to describe how you do this for a newsletter capture lightbox in Squarespace.


It turns out that there are three ways to do this although only one works for me. I am listing all three in case my environment is weird and the other ways might work for you.


1. Use Javascript shenanigans:

Essentially, what you want is to pass the event code to Google Analytics only when the submit button on the lightbox is clicked. For that you set up a listener to call a function which fires the event tracking code when called. This is very well described by Rocketeer SEO Hero and also by Silvabokis.

This did not work for me. Even though I tried several combinations but the variable value that should get assigned to 1, never happened.

2. Try and force Google Tag Manager(GTM) to do this for you:

GTM is not supported directly in Squarespace. You have to take your GTM header code below:

<!– Google Tag Manager –>

(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({‘gtm.start’:

new Date().getTime(),event:’gtm.js’});var f=d.getElementsByTagName(s)[0],

j=d.createElement(s),dl=l!=’dataLayer’?’&l=’+l:”;j.async=true;j.src=

https://www.googletagmanager.com/gtm.js?id=’+i+dl;f.parentNode.insertBefore(j,f);

})(window,document,’script’,’dataLayer’,’GTM-XXXXXX’);

<!– End Google Tag Manager –>

and put this on Config  — >  Settings  –> Advanced  –> Injection (Header)

Then take the code that should reside in the body tag

<!– Google Tag Manager (noscript) –>

<noscript>https://www.googletagmanager.com/ns.html?id=GTM-MN8VFPH</noscript>

<!– End Google Tag Manager (noscript) –>

and put it here  Config  — >  Settings  –> Advanced  –> Injection (Footer)

This is also described well by Yoweb.

Now go to Google Tag Manager and build an event only tag that collects data when a trigger is fired upon a particular form class is seen. Please see this wonderful description ( read carefully for this process is convoluted) by Atomic Marketing.



3. Try to play within Squarespace:

This is a simple technique and did work for me. Go to the newsletter form and click on edit.

form_edit_GA_SS

Click on Advanced and then scroll down to ” Post-Submit HTML”.

Now, this is a place where you put in the event call as follows:

   ga(‘send’, ‘event’, ‘newsletter’, ‘click’, ‘submit’);

 

Effectively, you are stating the Event Category [newsletter], Event Action [click] and Event Label [submit].

Go into the Google Analytics interface and add these values as a desirable goal and you are done. This method is quite simple but please be aware that this may not work like this if Google stops supporting this or Squarespace updates their codebase.

In any event, I hope this article is of some use. Do let me know if you have any further questions.

Analytics, Freelancing

The virtues and challenges of Freelancing

The days go by and you are sitting at your desk at home waiting….

…waiting for someone to respond. That great job post you saw yesterday was just so tailor-made for you. They have to call you! They would be stupid not to.

…and you wait some more. You watch TV in frustration thinking of how you are just wasting your life away for calls that never come; messages that go unanswered; and proposal that go unseen.

The perils of freelancing are many. Waiting for someone to give you a first break is one. In my early months, I always thought that I was doing something wrong, hence the lack of jobs. Slowly, I realized that while I did make mistakes, the nature of the business is such that it will take you years to get settled. Particularly, if you don’t have actionable coding skills. So waiting is a significant part of the job.

The other problem that most of us who are not salespeople encounter is the amount of rejection that is the norm. When working for a company, your work is not rejected everyday. There is an automatic buy-in from your employer on whatever you do within certain parameters like performance reviews. While freelancing, one is rejected constantly. Over time time, I have learnt to expect 90% rejection, at least. Once you do that, it becomes the new norm and you don’t lose too much sleep over it.

A third major issue I encountered was the constant selling of yourself or your skills. One doesn’t have to do this in a regular job. It is taken as read by your colleagues that your skills are of some value. One could argue that you make a better case for advancement in an organization if you sell your ideas better than others. However, in freelancing it is all about the sales pitch. You have to hone several pitches for different kinds of jobs and be unremitting in your proposal follow-ups. No one looks at your resume and very few actually read your profile. Almost all of my jobs are a result of personal conversation via Skype or the phone. Conversations that were all about selling myself!

The great joys of working on your own time are many too. I have gone through a very bad health phase ( a bit of jujitsu with cancer) and this allowed me to work whenever I was able to. The flexibility that a freelancer has is probably the most important selling point to this style of work. There is true joy in working at your own convenience. Be disciplined and keep weekly to-do lists. You are your own boss and employee too.

Working on various different projects and problems also forces you to keep on top of new technologies and better ways of doing work. Continuing education is another great asset of freelancing. I have learnt more about coding in the last six months than I did in the last three years. There is no administration overhead and that generates enormous amounts of free time for one to learn. I usually look to UdemyCoursera and the O’Rielly Bookshelf to help stay in touch with all the goings on out there. Youtube is a serious source of learning too.

Another thing that relates to one’s usage of time is the opportunity to just get up and go somewhere during the day. The time of rest between jobs and within them cannot be had in any other lifestyle. I have found time to go to the museums, drive around for fun and volunteer for various non-profit organizations. I have found a lot more time to cultivate relationships and talk to my family: the important stuff of living, really.

It’s a good life but in the beginning, like every business, it is a hard life. You just need to remember not to let the waiting, rejection and relentless sales pitches get to you. Also, make sure that you continue to bid or reach out for jobs all the time. Don’t sit back. A freelancer, ironically, cannot afford to be too relaxed.

Still interested in going down this garden path…

Then the best places that you can freelance in my opinion are, UpworkToptal web developers Community and Freelancer. You can also find some freelance work on Linkedin if you build relationships there.

Let me know if you have any questions.  I will be happy to help.

Analytics

Learning from Twitter

Three quick learning points from Twitter over the last month

  • Always follow back people who follow you.
    • if someone follows you, it is only decent to check out their twitter feed and follow them back if your interests match.
    • Re-tweet their pinned tweet or another prominent tweet that you read and liked. Yes, you need to make that effort. It will enrich your feed too.
    • Check out their followers and follow them too. This is not a contest on who has more followers but more an opportunity for you touch base with thought leaders in your domain.
  • Make sure you put an effort towards providing good content to your followers.
    • Everyday, I am devoting time to my mailing lists and emails to make sure that I can recommend some good reads to my followers.
    • Post images and constantly change the content of your pinned tweet. It garners more attention in Twitter world.
    • Without realizing it, you are running a daily newspaper. You don’t need to get frazzled but 4 to 5 good posts a day will keep your followers engaged.
    • This will show in re-tweets and replies and likes. I get on average 1, 1 and 3 respectively.
  • This is a great channel to build relationships.
    • You will be surprised how many people will write you directly and offer to help. Take them up on the offer and offer your own help. Do not talk money. We all know the difference between favors and paid work.
    • When re-tweeting, please try to mention your own take on the thread or link. It will help other in your list make sense of what is being talked about.

I hear a lot of conversation about monetizing social media channels and earning millions of dollars a month. Well, of course no one minds earning that kind of money. However, like everything else, this is an activity that requires a lot of effort. Take an hour or two a day to do this well.

My amazing experience with Twitter traffic started on Jan 20st, 2017 when my following suddenly rose  from 550 to 650 within a day. I was delighted but puzzled. I still am. My handle @ateeqhmad has been around for 7 years with barely anyone listening and then suddenly a huge jump.

It didn’t stop there either. By Feb 1st, 2017 , my followers were up beyond the 1,000 mark and are still slowly climbing everyday.  I had some great interactions with people; absorbed a lot of good ideas and learnt that this is a wonderful tool to interact with others.

There are several good Social Media tools out there. Use them if you have $20 a month to spare. However, I would advise against too much automation. It takes away from the spontaneity of life.

Most importantly, have fun!