And the web analyst woke. Memories from a the past lives alive, as if a dream. And then, he thought of something to solve the problem at hand..

Haha.. that’s it. I was meaning to write a post about some random learnings from doing web analytics. And in addition to that I have been watching Westworld lately, so thought of naming the post Reveries – based on some occurance in Westworld. The post will be sharing my learnings about importing Google Analytics data in DOMO, tracking Marketo form submits in Google Tag Manager and sharing some of the Google Sheets Formulas I have been using a lot. These learning/tricks have been very useful to me and I believe it will be to you too!

How to track Marketo form submits in Google Analytics?

Marketo is used by many many businesses to capture leads and marketing automation. It is a powerful tool.

But how do we track when someone submits a marketo form in Google Analytics as an event? It would be incredibly valuable to do it as it a major conversion action for B2B sites.

We have the answer below. What we need is a Google Tag Manager (GTM) custom HTML tag and an another Google Analytics Event Tag in GTM.

Step one – 

Create a custom HTML tag and paste the code in it. Have it fire on pageview. We did say some JS error in chrome console for pages that does not contain a market form as it tries to see if there is Marketo form. So we had created another data layer variable which is ‘True’ when the page contains the Marketo form and the following script would fire then.

<script>
MktoForms2.whenReady(function (form) {
form.onSubmit(function(){
var vals = form.vals();
dataLayer.push({
‘event’: ‘marketoFormSubmit’,
‘marketoLeadSource’: vals[‘LeadSource’],
‘marketoOriginalSource’: vals[‘Original_Source_Detail__c’],
‘marketoCurrentSource’: vals[‘Source_Detail__c’]
});
});
});
</script>

 

Step 2 – This would push an event called ‘marketoFormSubmit’ to GTM, as shown in the image.

 

 

 

Step 3 – Now using this event pushed to GTM we can have it trigger almost everything. Create a trigger. You can create a new trigger as a custom event type and name it whatever your marketo event is – in this case marketoFormSubmit.

 

 

Step 4 – Create a Google Analytics Event which triggers off of our newly created trigger in step 2.

 

 

 

 

And hola – your Marketo tracking is happening in Google Analytics. Let us know in the comments if this tip was helpful.

Google Analytics data in DOMO and using calculated fields

At MangoBlogger we love to tell a story through data. To that effect we use Tableau, Google Data Studio and DOMO as needed by the client.

I for one love DOMO. I like how easy it is to use. When you use the Google Analytics connector for DOMO it creates some lovely reports. But what to do when you want to change the “Week Of the Year” dimension from Google Analytics to read as “Week of the year 25” instead of just “25” or when you want to create a bar chart of pageviews by different sections on your website and you do not want to go through the setting up content groupings?

You can use DOMO’s calculated field feature in this case. Calculated field creates dimensions in your DOMO dataset which reads as =yourCalculatedFieldname. These can be used in your data.

There are two cases we will talk about when you can use a calculated field in DOMO.

Case 1 – Create a calculated field by concatenating string with a dimension name to create a dimension which reads “Week of the Year 25” instead of just 25. It makes reports easy to read.

Create a calculated field by using – CONCAT(“String Name”, Dimension). As shown in the below screenshot.

Case 2 – Create a dimension which allows you to filter data by some dimensions like page types. As shown in the below screenshot. 

These calculated fields work on SQL.

You can read more about SQL wildcards and functions on W3Schools to create a calculated field as per your need.

Google Sheets Formulas useful for SEOs and Web Analysts

Last but not the least – Google Sheets. Following are some of my favorite formulas to use in Google Sheets.

CONCAT = It just adds to strings. Helpful when you want to create a string out of a page path.

ARRAYFORMULA = Wrap your formula in ARRAYFORMULA and increase the range to eliminate dragging and dropping of formulas. You can find a nice intro here. Keep in mind that you can wrap any formula in ARRAYFORMULA.

IMPORTXML – I love importXML. You can basically import contents of a page based on their HTML tag to a spreadsheet. Imagine you have a huge sheet with URLs and you want to check their titles to improve SEO. You are not going to go and check the title of each one, are you? Use this formula =IMPORTXML(“https://www.mangoblogger.com”,“//title”) and it will fetch the page titles for you! You can use it to get h1 tag (=IMPORTXML(“https://www.mangoblogger.com”,“//h1”), paragrah (=IMPORTXML(“https://www.mangoblogger.com”,“//p”)) or whatever else you want.  

IF & IFERROR – Check some cells and based on their values edit another cell. For example, based on HTTP status or pageviews you want to purge content. If a page has less than 400 pageviews, delete it. Use IF formula to check if the page views are less than 400 in a cell and change the values of another cell based on that.

VLookup – Useful to compare two sets of data. For example, in one sheet you have a list of URLs with their HTTP status and another sheet you have a URL with pageviews. The two sets of URLs are not identical. And you want to add HTTP status for URLs which have it in set 1 to set 2. Then you will use Vlookup to compare both data sets and append values to one dataset when they are present in another dataset.


Did you like the post? Let us know in the comments below and if you found it useful then please do share it!

Additionally, if you want to check HTTP status of URLs in a google sheet you can use our Google Sheets add-on – SEOMango. It automates many of the functions that SEOs have to do.

Upcoming weekly website email reporting feature - give feedback.. | Dismiss