How to use Google offline conversion for Purchase? - google-analytics

I have a sheet which mentioned all the purchase data of my customers, I want to add all of these in Google Analytics as an e-commerce transaction. So can I send it via API? if yes then how?
I have order_id, source, click_id, campaign, purchase_date, purchase_time, purchase_amt columns in spreadsheet.
Is these data are enough or not for API?

You can send them with measurement protocol with transaction or purchase: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#ti
Measuring Purchases (parameters example)
https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide#measuring-purchases
However you can't send data for the past, so all transaction will be associated on the day you sent the hit.

Related

Can I send a record like (multiple data items) to google analytics and analyse with any of these data?

From backend java spring application, I need to send the following record per a specific api call to google analysitcs:
user_name,IP,time,...etc
Then I need to analyse data using one of these data (user_name,IP,time,...etc).
Can I utilize google analytics in that? or even is there any other cloud services to achieve that?
You could but you can't, that's because Analytics customers are prohibited from sending personal information to Google:
The Analytics terms of service, which all Analytics customers must adhere to, prohibits sending personally identifiable information (PII) to Analytics (such as names, social security numbers, email addresses, or any similar data), or data that permanently identifies a particular device (such as a mobile phone’s unique device identifier if such an identifier cannot be reset). Learn more about how to avoid sending PII. Your Analytics account could be terminated and your data destroyed if you use any of this information.
https://support.google.com/analytics/answer/2795983?hl=en

Using UID to pass transaction data to GA in measurement protocol

We have a Lead generation website, where conversion action is a form submit. A percentage of these leads get enrolled offline.
We plan to use measurement protocol to tie-back this revenue to google analytics.
The set-up is as follows:
Enable User-ID feature in Google Analytics
Sending the Unique ID generated by our CRM software as the User-ID in google analytics.
When one of the lead converts offline, we pass that information back to GA - and the associated UID shows the final conversion as well.
How do we proceed with step 3 and tie-back the revenue to the User-ID from transactions that happened offline?
As per explanation given in measurement protocol, only CID can be used to send the transaction values to GA.
Is it possible to do it using UID only?
Thanks
It is possible to send a UserID via the measurement protocol please see the following page for details:
https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#uid
In essence you add &uid=USER_ID to your request URL
However you must also supply a ClientId, the usual approach would be to store the ClientID of the user against the user record in your database when they submit the form online, which you can then later use to reattach to the request you send via the measurement protocol.
To get the clientId from the form is simple
ga(function(tracker) {
var clientId = tracker.get('clientId');
});
https://developers.google.com/analytics/devguides/collection/analyticsjs/cookies-user-id#getting_the_client_id_from_the_cookie

Delayed transaction and price calculation in Google Analytics Enhanced Ecommerce with Tag Manager

I have an online accommodation booking site, which uses Google Analytics with enabled Enhanced Ecommerce through Google Tag Manager.
The question is, how can I set up a delayed transaction?
What I mean:
When out visitors come to the site, they just send an offer request for the accommodation owners. At this time we know only the transaction id and the selected products, but not the price.
Later, the accommodations owners calculate the price, and send an offer back to the client. This step is always made by the accommodation owner or the site admin, but never by the original client. This is the time when the transaction actually should made for the original client.
How can I achieve that this transaction go to the original client but with the data calculated later?
You should use Measurement Protocol for this, it can't be done in GTM.
You can send transaction not later than 4 hours after visitor's request being initiated.
You'll have to save additional data about your visitors on your servers to build MP request later:
IP address (&uip),
user agent (&ua),
client ID (&cid),
time since the initial request (&qt).

Google Analytics Enhanced Ecommerce Questions

I'm trying to implement the Enhanced Ecommerce tracking with Google Analytics and ran into a few questions.
Can you only send impressions with the pageview event? So how would I send impressions of items loaded after the initial pageview event?
I wanted to send product impressions on search result pages, which are in blocks of 10. When I try to send along with the pageview, it never sends, I'm guessing because it's too long for Google, so how would I send multiple at 1 time? I can get upto 6 products and have it still work.
Should I just use an event to track impressions? Would this solve the sending and size issue if I made a call for each product?
Any guidance would be appreciated. I feel the documentation is lacking a bit with some specifics.
You don't need to necessarily send ecomm data with the pageview. As stated here https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce, in the "Sending Enhanced Ecommerce Data" section:
Note: Ecommerce data can only be sent with an existing hit, for example a pageview or event. If you use ecommerce commands but do not send any hits, or the hit is sent before the ecommerce command then the ecommerce data will not be sent.
There's also more information in this SO post: Tracking catalog product impressions - Enhanced Ecommerce Google Analytics.
I'm not sure if there is a hit limit for EE transactions as there are for other types of hits (limit of 500 hits per session), but if you are worried that you'll reach some limit, whether it's EE or not, or if you think you'll send more than 20 hits per second, then you can throttle the hits being sent to Google.

How to create a report that shows event label and source/medium using google analytics

I'm firing an event to GA that looks like:
_gaq.push(['_trackEvent', 'Subscribe Modal', 'submit', 'test#test.com']);
This tracks when a user has entered their email to sign up for a newsletter where 'test#test.com' is the email address they entered.
What I would like to do is generate a table from GA that lists each recorded email address and the source/medium associated with that event.
I'm not sure is this is possible but any help would be appreciated.
You do know that you are not allowed to upload personally identifiable data to Google Analytics, according to Googles TOS?
Google Analytics protects the confidentiality of your data in several ways:
Google Analytics customers are prohibited from sending personal information to Google.
The Google Analytics terms of service, which all Google Analytics customers must adhere to, prohibits sending personally identifiable information (PII) to Google Analytics. PII includes any data that can be used by Google to identify an individual, including (but not limited to) names, email addresses or billing information.
Data cannot be shared without consent.
Google Analytics data may not be shared without customer consent, except under certain limited circumstances, such as when required by law.
Google Analytics continues to invest in security.
Security-dedicated engineering teams at Google guard against external threats to data. Internal access to data (e.g. by employees) is regulated and subject to the Employee Access Controls and Procedures.
Please read further here: https://support.google.com/analytics/answer/6004245?hl=en-GB
But to answer your question, that is indeed possible. Look at the area called "Secondary Dimension" on the "Top events"-report page. There you can choose if you want to see Source/Medium, only Sources or only Medium, as in this screenshot:

Resources