Adding Google Analytics and Google Ads Conversion tags to Cvent landing pages

Step 1

Cvent has provided a guide to add Google Analytics integration to its landing pages. Please pick up the guide here and follow the steps 1 to 3 on page 9. Please enable the linker plugin there too. See picture below:


Step 2

Now, that Google Tracking is in place, add the conversion tracking code for Google Ads.

Please add the two code snippets posted below to the “Admin>Account>Account>Code Snippets>”. Please follow this video for the details.

The re-marketing pixel for each Cvent form:


<!– Global site tag (gtag.js) – Google Ads: 1002231020 –><script async src=”“></script><script>  window.dataLayer = window.dataLayer || [];  function gtag(){dataLayer.push(arguments);}  gtag(‘js’, new Date());
  gtag(‘config’, ‘AW-1002231020’);



The conversion pixel for each time a lead is submitted via Cvent:

<!– Event snippet for Cvent Form Conversion conversion page –> <script>  gtag(‘event’, ‘conversion’, {‘send_to’: ‘AW-1002231020/bYQ2CJDy25oBEOyp890D’});</script>

Step 3

Once done, and the code is assigned to the right places, as per the video link above, please enable cross-domain tracking from within Google Analytics. Excellent video provided by Benjamin at

Step 4

One more thing left to do is to add to the Referral Domain Exclusion list in Google Analytics. To do that, please go to the Property( the middle portion of the Analytics account) as shown below

Please click on the yellow “Referral Exclusion List” and enter this text into the referral exclusion list.

That’s it! You are done and will be able to track Google Ads conversions as well as page views on the Cvent landing pages to your heart’s content.

The same process can be followed for Facebook and other traffic sources by just replacing the code in Step 2 with the equivalent for tracking the other traffic sources.

I do realize that this is a bit confusing so I can get on a call with the developer putting this in place if needed. To contact me, get me on Upwork or just write to me here.

Analytics, Google Tag Manager, Shopify

How to Enable Google Tag Manager in Shopify

I get lots of questions on how to add events in Spotify. It is tough to do that without using Google Tag Manager(GTM). However, there is no space in Spotify preferences to add the GTM code. So one is stymied.

Not quite. There is a sneakier way to still do this. So let’s give it a shot.

Step 1

First, add the UA-XXXXXXXX code that you get from Google Analytics into the box marked in Shopify as seen in the picture below.

 To get to this page, you need to click on “Online Store” on the left Menu and then click “Preferences”.

Step 2

Now, go and build a GTM container. An excellent video to show you how.

Now that you are done deploying Google Tag Manager, put a couple of events together in the container besides page view tracking.

Step 3

Let’s choose scroll tracking and outbound click tracking because they can apply to pretty much every website.

For Scroll Tracking, again an excellent video by LovesData will guide you.

Now, try and put together an event for tracking outbound links. We will use another great video by Whole Whale on YouTube.

Step 4

Now that you have configured both events, go ahead and pause the tag for page view tracking. Let me show you how to do that.

Step 5

Now that all these steps are done, copy the code for the header from GTM. It will look like this

<!– Google Tag Manager –>


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




<!– End Google Tag Manager –>

Step 6

Let’s go back to the Shopify interface and add the GTM code above into the yellow area shown in the image below

Click Save in the top right corner(not shown in the picture).

This is going to make sure that all the events that are added can be fired through Google Tag Manager. The page view collection will be done by the Shopify integrated Google Analytics code. In case you are not able to add the GTM code and get an error that says, “Analytics extras is disabled for the moment. Contact support to enable editing of this field”, you do not have admin permissions. Either get them assigned to you or ask the admin to put in this code for you.

Step 7

There is just one more thing, add a product in your shopping cart and go to the “/cart” page. You will notice that GTM does not show up at all. This is a bit of a doozy and has to do with the interaction between GTM and Shopify. To get over this, you will have to take the footer code in GTM, given below:

<!– Google Tag Manager (noscript) –>

<noscript><iframe src=””

height=”0″ width=”0″ style=”display:none;visibility:hidden”></iframe></noscript>

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

..and add it to the start of the <body> tag in theme. liquid file. You can place it at the end of the body tag too. This will enable GTM code on the checkout page. Please save the theme.liquid file and please re-load the website to make sure nothing is broken. Of necessity, you are doing this in production( small shops don’t have a staging Shopify environment), so it pays to be extra careful.

What happens if the site breaks?

Don’t panic! Just revert to the earlier theme.liquid file and make sure that your copy-paste job has the correct code. Re-input the code within the body tag; save again and check again. If it doesn’t work again, revert to previously working code and notify your programmer. They will help you fix this issue.

This is a hack and you should not assume that it will work in your account. Please test and make sure that only one pageview tracker is firing. A surefire way to know that two trackers are firing is to observe bounce rates in Google Analytics. They will immediately go to zero.

I hope this works for you. Do let me know if you have any questions.


Indian Elections and Google Trends

Google Searches for Mr. Modi

Mr. Banerjee at very interestingly put together a post saying the Google Trends predicts another government by Mr. Modi for the next five years. The elegant chart below tries to reproduce from Google Trends exactly his findings.

Last 90 days party comparisons

We are looking at data for the last 90 days in India. As you can see, it’s all BJP! So is he right?

Well, it depends….

You see, the way that Google Trends displays data is by an index of the most popular of the terms being compared. In this case, BJP is undeniably more popular. However, if we see the search for each party individually and try to figure out who is increasingly more popular( only on Google though), these are the pictures that emerge.


Indian National Congress

Although the charts show that BJP’s popularity is on a sharper decline, both parties’ popularity is on the wane, with BJP holding more sway in UP, Odisha and West Bengal. For the INC index, it shows higher values in Rajasthan, Madhya Pradesh and the North Eastern states.

These are indexed numbers so the fact that BJP is searched for more is still not challenged. It’s just the luster seems to be going off a bit in the last few months. The Prime Minister though, asks for votes these days in his name, rather than the BJP. Let’s compare the two search terms.

Well, well! What do you know! It seems that the data people for the BJP have been urging him to take that line because while the BJP’s popularity is on the downswing, Mr. Modi is riding high.

However, this is still an index of search terms, not actual values. Perhaps, we should try and compare the popularity of the Prime Minister for a longer term and see how that has changed over time.

So, we go back 6 years and see where things were then for Mr. Modi.

As you can see, this search term is about half as popular in India as it was in May-2014. It seems to be showing a rising trend now but would it go to the same level as that resounding victory? It’s anybody’s guess right now.

Considering that the BJP is the incumbent on 72 out of the 80 seats in Uttar Pradesh, how does the Prime Minister find himself in the top districts there?

Nowhere near his peak except for a couple of districts.

So what does this all mean?

Looking at the data from various perspectives adds to our understanding of it and perhaps muddies a clear-cut decision. In this case, perhaps all we can say is that this specific dataset does not pre-sage a clear victory for anyone. Particularly, if we consider the fact that there is no measure of sentiment involved here. Look at this picture of Google Suggest and you will see what I mean.

Google thinks the searcher(I am incognito) is more interested in his wife, caste and education. So dear reader, that’s why economists are prone to always say “It depends”.

Analytics, Google Tag Manager

Tracking Google Analytics Events in Squarespace


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 –>


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




<!– 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) –>


<!– 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.


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.