Repartitioning Google Analytics data based on publish date - google-analytics

I'm looking to repartition Google analytics data from stats date tables (the default export we get each day) to dated tables based on published date of each article URL (a custom dim we have). This is for more efficient querying by publish date by a BI dashboard that needs to calculate user counts on the fly for arbitrary date ranges.
So plan is to append data each day to the relevant publish dated tables. Just wondering if there is an easy way to do this or if I need to look though each stats date data for all the publish dates that had hits each day and then append one by one to relevant publish date tables?

Related

Google Analytics Ad Cost Upload Mismatch

I have a problem with cost data uploaded to Google Analytics via the Management API.
The script itself works just fine. On a daily schedule it uploads a CSV from BigQuery to the management API. But in some cases the cost data shown in the UI is different from the data in the upload file.
For example:
In my BigQuery Table is see costs of 349.44 for a certain campaign on a certain date.
In the UI for the same campaign and date I see 92.31.
If I download the uploaded CSV again from the Data Upload section I see 257.13.
So three different numbers in three places that should not differ.
For the same campaign and other dates the data is correct.
All costs are in EUR so no currency conversion takes place and not just recent data is affected but also data from many month ago. I haven't found any resources that address this issue and would be greatful for any input.

GA report API v4, I want to update data every minute. How to update data if there is no identifier?

I have some criteria for the report and I want to add them to postresql and update for example every minute.Should i have to call reporting api for the current day and overwrite all the data for the current day?
calling reporting API every second for today's data has a little sense since Analytics data processing lag is 24-48 hours and most probably your data won't be updated with 1-sec frequency.
Also, the only convenient way to export data to own storage from API is scheduled calling reporting API for a dynamically generated date range (like last seven days) and overwriting the existing data in the storage.
You might add ga:date to your reported dimensions to get your report data date-wise so you'll be able to track what needs to be updated.

Find difference in days between two date fields in Infopath

Could someone help me with determining the difference in days between two date fields in InfoPath forms.
Usual subtraction doesn't work with the date fields. like DateField1 - DateField2. Any code or no code solution is highly appreciated.
There are ways to get difference of dates in InfoPath, but they are very complex and involve writing rules and parsing the date into month/day/year. Instead, I recommend this method described elsewhere that uses Excel Services. Because Excel is excellent at calculations, it makes sense to write the calculations in Excel and call the Excel document from InfoPath (if you have SharePoint with Excel Services).
Here are 2 sets of instructions on how to set up InfoPath and Excel Services. The instructions are long and/or copyrighted so I cannot include them here, but to summarize you would set up new Data Connections in InfoPath to use web services (SOAP) open the Excel document and set the date fields based on your InfoPath date fields and retrieve the calculated value from Excel.
Calculating date differences in InfoPath using SharePoint Excel Services
InfoPath and Excel Services
It took me about an hour to get it working because I had to do some trial & error with the Trusted Location settings.
I utilize a separate SharePoint list to help calculate the number of days between two dates in Infopath. This is so I can account for leap years and have the ability to just count work days, not all days. I update this list with new data once a year.
Here is the Excel file source for the list containing 2018-2020 data: https://1drv.ms/x/s!ApLhBloaS1wVgsUOMRrRfbekFftY9Q
Steps:
Import the first worksheet of the above Excel file as a new list in Sharepoint.
Add a receive data connection to this list from your InfoPath form.
For the first date, create a action to convert the date to a number in YYYYMMDD format. Assuming the date is stored as DateTime, you can use this formula:
floor(number(translate(substring-before(../my:endDate, "T"), "-", "")))
Query the list for the number value of the first date. Store this number in a field (column) in your form. (This field does not need to show in your form.)
Repeat steps 3 & 4for the second date.
Subtract the first date number from the 2nd, store this in a third column.
Note: The Excel file uses the formula "NETWORKDAYS" and includes columns for weekdays, weekdays minus US Federal holidays, and weekdays minus NYSE holidays. Now you can get the number of work days between two dates using one of these columns. If you live outside the US, you could add a column to the Excel for other holidays, such as UK bank holidays.

Import customer reporting schedule into Google Analytics

The company I work for has a custom reporting schedule, similar to the month specific groups four or more weeks are grouped into 'periods'. I have a mapping from date to period that I wish to upload to Google Analytics using its data import function.
When I get to selecting the schema on the data import tool there is no option to select the date as the key to join my data on.
Is this possible in Google Analytics? What is the correct method?
No, this is for the most part not possible; imported data is applied to incoming data but not to data that has already been collected, and then it is applied to all hits, not to a specific timeframe. Also you cannot create new interactions, you can only amend or change interaction data as it is being collected.
Google Analytics Premium (now 360) accounts have a feature called query time imports where imported data is applied to existing data in GA. This still does not allow you to selected a date as key, but if you have created a custom dimension and stored a date in there you should be able to make this work (since you can select a custom dimension as key field); however if have not actually tested this, so this is an educated guess.
But for the most part no, this does not work in GA and there is no correct method for your use case.

Is there an option in Google Analytics to compare the Search Engine results for two different time ranges?

In the Google Analytics in the Search Engine Optimization there is an option to see all the queries that've been used to find the my page. I would like to create an custom report to compare two different date ranges (e.g. march 2014 compared to June 2014) and i would like to see and compare what was the Average Position/Impressions for one query durring March 2014 and what are the values (average possition/impressions) for the same query for the current date.
Is there such an option in google analytics? or i need to export data from one date range and from another one and then use Excel/Google Spreadsheet to create such a report?
The calendar in which you select your timeframe has a compare option (which works with almost any report in GA). I assume that is what you mean ?

Resources