Tracking and grouping parameter based Goal Destination URL in Google Analytics - google-analytics

I have a reservation.php page and on success, the page returns/post a 5 digit Confirmation No. as part of the URL. e.g. /reservation.php?Success=&ConfirmationNo=29564
In Google Analytics > Admin > Goals Detail > Destination URL, I have set the type "Begins with" and set the URL to /reservation.php?Success=&ConfirmationNo= But in Reporting > Conversions > Goals > Overview, it do not group (Goal Completion Location) all reservations into one goal URL instead showing each reservation URL separately. e.g.
Goal Completion Location:
/reservation.php?Success=&ConfirmationNo=29566
/reservation.php?Success=&ConfirmationNo=29567
/reservation.php?Success=&ConfirmationNo=29568
So I unable to compare the number of reservations with the previous month. I want it to show something like /reservation.php?Success=&ConfirmationNo= as one location with number of reservations in a period selected.
I tried to add . or * or .* at the end of URL and selected both "Begins with" and regular expression to group all the reservations but "Verify this goal" tool do not accept any of these and shows 0% completion in last 7 days.
Can you please help how can I group all my reservations into 1 Goal Completion Location?

Well Google Analytics does exactly what you told it to do. There are two different things:
Goal - a goal is triggered when the URL starts with /reservation.php?Success=&ConfirmationNo=
Goal completion location - simply shows the actual location where the goal happened
If you want to compare goals by month, go to Conversions -> Goals -> Overview. At the top left, choose name of your target in the dropdown menu (below segments). At the top right, choose grouping by month. At the very top right, choose the time period for which you want to compare data (at least two months).
Now you will see the chart of number of goals per each month in the specified time period.
If you are still unhappy with this reporting, then pass the variable ConfirmationNo in the $_POST field instead of the $_GET field.

Related

Facebook Pixel: mismatched content_id values - how to fix?

I would greatly appreciate some help with my current Facebook catalog ad predicament.
For a product with stock number 12345, our data feed brings it into the Facebook catalog as 616_12345 (the 616_ is consistent). This is the content_id.
To match the FB pixel content_id and track events, the stock number in the catalog needs to match the stock number on the site. So no events are being recorded.
I am managing the pixel and events through Google Tag Manager. I have set up a CSS selector that points to the stock number in an unordered list, but of course it just returns 12345.
Is there a way to create a variable in GTM that assumes a "616_" will be added before the stock number?
I've been told there is no way to remove that 616_ from the data feed - so this is the only option I can think of.
Thanks very much in advance!
Yes there is a way to create a variable in GTM - simple create "Constant" variable and set its' value to "616_". You can then reference this variable in your events and tags by simply using double curly brackets like so: {{VariableName}} . You can find detailed information here.

Google analytics API: different sum of sessions with 'ga:eventLabel' function and without it

I added 'ga:eventLabel' function to my script and sum of sessions decreased from 2238 to 994. Why?
I expect the same result from both script
dim=['ga:eventLabel', 'ga:source','ga:sourceMedium']
met=['ga:sessions', 'ga:users']
start_date='2019-07-01'
end_date='2019-07-03'
transaction_type='Goal'
goal_number=''
refresh_token=token
condition=''
data_2=google_analytics_reporting_api_data_extraction(viewID,dim,met,start_date,end_date,refresh_token,transaction_type,goal_number,condition)
viewID='*********'
dim=['ga:source','ga:sourceMedium']
met=['ga:sessions', 'ga:users']
start_date='2019-07-01'
end_date='2019-07-03'
transaction_type='Goal'
goal_number=''
refresh_token=token
condition=''
data=google_analytics_reporting_api_data_extraction(viewID,dim,met,start_date,end_date, refresh_token,transaction_type, goal_number,condition)```
Here are the results:
--
The two queries have two different meanings, and won't give you the same result, unless you have a data set, where all sessions have at least one event type hit associated with them.
The first query says: count all my users and sessions for the given date range, breaking it down by event label, source, source/medium and date. So in this case, you implicitly filter for any known event labels, where (not set) is an empty, but existing label for a recorded event. Sessions without any events are excluded.
The second query says: count all my users and sessions for the given date range, breaking it down by source, source/medium and date (regardless, if they had any events).
You can verify this behavior, if you create these custom reports in Google Analytics web UI. It is similar to querying custom dimensions: if no value was set for a given custom dimension, those records are excluded.

Google Analytics Checkout Behaviour in Bigquery

does anyone know how to extract checkout behaviour from the Google Analytics export in BigQuery?
E.g. I'd like to calculate abandonment at each checkout stage. I've raked through the schema -
https://support.google.com/analytics/answer/3437719?hl=en&ref_topic=3416089
but it doesn't seem to have the equivalent data from GA i.e. the details within shopping stages such as
"CHECKOUT_1_ABANDONMENT"
.
I can get each checkout step using hits_eCommerceAction_step but can't calculate exits here, they're always just blank when I do a count of hits.isExit
hits.isExit refers to the last page in the session. It will not help you here, unless you want to know if any step was also the session exit.
Regarding e-commerce steps, you could define the highest step number per session as being the exit step or the last one seen - but I guess the highest makes more sense?!
Oh, and you have to translate what each step number means by yourself. It literally just tracks the number, not the meaning.
You can do it like that:
SELECT
(SELECT MAX(ecommerceaction.step) FROM t.hits) AS maxStep,
SUM(totals.visits) AS sessions
FROM `project.dataset.ga_sessions_2018*` t
GROUP BY 1
ORDER BY 1
If you want the "last step in a session"-logic, you would do it like that:
SELECT
(SELECT ecommerceaction.step FROM t.hits WHERE ecommerceaction.step is not null ORDER BY hitnumber DESC LIMIT 1) AS lastStep,
SUM(totals.visits) AS sessions
FROM `project.dataset.ga_sessions_2018*` t
GROUP BY 1
ORDER BY 1
I didn't check if these are translations to Google Analytics numbers but should be helpful, I hope, getting in this direction.

Working with event stat in google analytics api

I have the website where merchants sell some stuff. Each item has stats like unique views during last 24 hours, a week and a month and a number of visitors that clicked on "show contacts" button. Uniqueness based on IP. This works, there're huge tables that collects all (IP,item_id) pairs during the last month, and there're a lot of updates.
Today I dig into google analytics api, I would like to know if it's possible to use it instead of my system.
The fact is all this stat is private, available only for merchant, so I don't need to have all stat at a time (it's not compared etc.). So it might be requested on demand for the specific item.
I created service account, connected it to analytics data and it seems export works (based on this example). Then enabled event tracking for "show contacts" button.
For example, when user click on "show contacts" where should I add item_id? Is it eventLabel or eventValue? So, for item_id=1234 it should be
ga("send","event","Contacts","show","",1234) or ga("send","event","Contacts","show",1234)?
I'm confused with eventValue column in Top Events report (it seems that eventValue keeps a sum of all eventValues and even caculates Avg.Value). Does it mean item_id should be stored in eventLabel as string?
I added second, nonInteraction event for collecting item views, ga("send","event","Data","show","1234",1,{nonInteraction:true}). It count all events, but I need only unique ones (performed by unique visitors) in specified period of time (day, week, month). Is it possible?
1) The parameters are category, action, label and value. "Value" is a metric and is expected to be an integer. Since it's a metric it will be added up. So if you do
ga("send","event","Contacts","show","",1234)
you will increment a metric by 1234, not store an id. You do not want this (especially if you have a linked adwords account, since this will be used to calculate your "return on advertising spent").
You want to use your item_id as label, however label is a string. So what you need to do is:
ga("send","event","Contacts","show","1234")
i.e. wrap the value for your label in quotes.
2) Is there anything wrong with ga:uniqueEvents for your purposes ?

Google Analytics Funnel is Not Reporting

I'm having a problem with Google Analytics with the funnel report. Currently I'm tracking transactions but my funnel report is showing that no one is entering the funnel. I have a tricky set up.
1) We are using a third party vendor to run our shopping cart and ordering process they want their tracking code on the site and we want ours.
For example:
_gaq.push(
['_setAccount', 'UA-10187XXX-1'], // OurDomain.com GA property ID
['_setDomainName', '.OurDomain.com'],
['_setAllowLinker', true],
['_setAllowHash', false],
['_trackPageview', '/customer_shopping_cart_funnel/personal_info_customer.html'],
['b._setAccount', 'UA-12670XXX-3'] // vendors GA property ID
, ['b._trackPageview', '/customer_shopping_cart_funnel/personal_info_customer.html']
);
2) Once someone enters the ordering process some of the urls do not change. I tried using _trackPageView like this:
// example for each step
['_trackPageview', '/customer_shopping_cart_funnel/step1.html']
['_trackPageview', '/customer_shopping_cart_funnel/step2.html']
['_trackPageview', '/customer_shopping_cart_funnel/step3.html']
['_trackPageview', '/customer_shopping_cart_funnel/order_confirmation.html']
3) This is how the funnel should go:
User lands on page to chose country for ordering process
User enters shopping cart
User selects products (User is able to visit multiple products)
User enters in buying information
User reviews order and submits order
Order confirmation page
The problem I have is that we need to track from the page that shows the flags, but within the shopping experience they can move around to several pages.
With the funnel, from what I understand, you need to specifically list all of the steps. What I did is assigned each product page the same _trackPageView value so the step was always the same.
What can I do here to get the funnel to report correctly?
Are you able to track these pages in other reports? If so, I imagine the problem is with how your goal funnel is set up.
Ensure the URL's you've set for each step are correct, and match just as they are listed in your reports. If you're using a profile filter to change how URL's are shown in your reports, make sure to take that into account. It might also be a good idea to mark the flag page as being a required step, as well.
As for specifically listing all of the steps of a funnel, the pageviews that take place during the visits do not have to match the exact sequence of the funnel to count towards the funnel and goal.
As an example, lets say your funnel is step1 > step2 > step3 > order_confirmation.
A sequence of page views including additional pages not specified in the funnel, such as, step1 > step2 > step3 > contact_us > order_confirmation, will still count toward the goal funnel.
Additionally, as long as the first page of the funnel was viewed prior to reaching the goal, Google Analytics will artificially backfill the missed pages to have at least as many views as subsequent ones.
Using the same example funnel as above, visiting the pages step1 > step3 > order_confirmation will still count as meeting the funnel goal, even though step2 was skipped. And, step2 will be "backfilled" as having been viewed even though it wasn't.
Thus, Google Analytics will display any visit that includes a pageview of step1 prior to a pageview of order_confirmation as matching every step of every funnel that has step1 as the first step and order_confirmation as the Goal URL. This means that assigning each product page the same _trackPageView value is unnecessary for the goal funnel to track properly.

Resources