Marketo API Open Rate & Unsubscribe status - marketo

Is there a field within the Marketo API field list that shows the status for each email address listed in a program? Like can it show ("Opened", "Bounced") etc etc. I know there is a field for bounced but I am curious about open rate etc.
How does the Unsubscribe status work with Marketo? The documentation is unclear in that it shows that it is system generated (with no explanation of HOW) and then there is an Unsubscribe Status field that is supposed to populate the email address if they personally unsubscribed? I had 2,000 contacts populate as unsubscribed but 0 populate in the Unsubscribe Status field. This is a bit worrisome given again NO documentation whatsoever in how it populates.
I tried utilizing all fields provided from Marketo on their documentation site but I feel like there has to be a field that shows the status of each email - otherwise how does it show on the dashboard when you log-in? https://developers.marketo.com/rest-api/lead-database/fields/list-of-standard-fields/

Related

Possible to change Firebase callable Functions data on Front End?

I'm using Stripe and Firebase Function for payment. My current scenario for buying items in my app looks like the following.
Loading an Item, which is an firestore document with an Id and a price
User clicks on "Buy now for price", enters credit card information and confirems
I get a stripe source with an id, which to my knowledge contains information about the credit card
I call my firestore callable function and pass the stripeSourceId, itemID and the item.price
In my function I check if the user (from context) is authentiated, then I charge the user and save the bought item in the user data, to deisplay the item later
My concerns are the point 4. Is it possible for a user to hack my front end code in a way, so that after stripe returns the sourceId, the hacker would call the function with a different price or a different itemId to get a different item for another price? If that is the case, how could I fix this problem?
Anything you pass from the client to the server, can be changed by a malicious user. That's why you should never trust any data that comes directly from the server.
The solution is to only pass the itemID from the client, and have the server look up the price based on that. If the malicious user passes a different item ID, they'll just be buying a different item, but still at the price that you have set.
I highly recommend watching Five tips to secure your app from the Firebase Summit 2018 for more tips on securing your app.

How can we filter the google calendar events with attendee name

Is there any way to get the calendar events specifically with attendee name.
I have checked the API for this,
GET https://www.googleapis.com/calendar/v3/calendars/calendarId/events
If I pass event name with q='abc'. I able to get the matched event.
But particularly I want to pass the attendee name to get the event from calendar.
With the above API, I suspect we might get by using privateExtendedProperty or sharedExtendedProperty request parameters (propertyName=Name) but I didn't get. I stuck while passing the values and get the desired results.
The search for google calendar events is free text.
Free text search terms to find events that match these terms in any field, except for extended properties. Optional. (string)
Which means that you add the text you want to search for and it will search for that value in all of the fields its designed to search. You cant specifiy that it should check only items(attendees%252Femail) for example
example Just add the persons email address you want to search for then you will have to process it again on your end to ensure that its actually the attended thats set and not some other field.

How to fetch email marketing insights data from Marketo using API?

I am trying to fetch "Email Performance Report" from the platform
using API to analyze the KPI's like CTR etc by type of the email
(newsletter,email marketing etc).
I went through the documentation, however I didn't find endpoint from
which I can fetch the same.
Does anyone know if there is a way to get this information?
There is no endpoint to query reports directly. However, the good news is, that the “things” that make up an “Email Performance Report”, namely: email delivery, bounce, open and click are available to query via the API.
This means that you have to build the report yourself, but you can fetch the dataset to work on.
These “things” are called activity types (activity measured on a Lead) and can be fetched by querying against the Get Lead Activities endpoint, which is also mentioned as the Query in the API docs.
It sits at the GET /rest/v1/activities.json url and you have to pass a nextPageToken and the activityTypeIds as query parameters.
The nextPageToken indicates a datetime. Activities after that date will be returned by the call. To obtain one, you have to make a call to GET /rest/v1/activities/pagingtoken.json, where you have to specify the earliest datetime to retrieve activities from. See more about Paging Tokens.
To figure out the value of activityTypeIds, you first need to get the internal Ids of the activity types you are interested in. In order to do so, you have to query the GET /rest/v1/activities/types.json endpoint and look for the activity types with names like Send Email, Email Delivered, Email Bounced, Unsubscribe Email, Open Email and Click Email. (I don't know if these Ids are changing from instance to instance, but in ours these are from #6 to #11).
Once you have all of these bits at hand, you can make your request like that:
GET https://<INSTANCE_ID>.mktorest.com/rest/v1/activities.json?activityTypeIds=<TYPE_ID>&nextPageToken=<NEXTPAGE_TOKEN>&access_token=<ACCESS_TOKEN>
The result it gives is an array with items like below. Items can be filtered to specific email based on the primaryAttributeValue property and processed further accordingly.
{
"id":7370416,
"marketoGUID":"7170506",
"leadId":291305,
"activityDate":"2017-12-17T00:00:00Z",
"activityTypeId":11,// #11 = `Click Email`
"campaignId":1790,
"primaryAttributeValueId":1638,
"primaryAttributeValue":"EMAIL_NAME",// Name of the Email as seen in Marketo
"attributes":[
// …
]
}

sending offline measurment data - does cid have to match the original cid?

I need to send a cart status update based on an offline activity. My customers will add items to their cart online via the website but the final checkout and purchase happen offline.
Here is my question: In the example below, a checkout step is updated. Does the client_id provided in this step have to match the original client_id used when the web user started their cart originally?
Measuring Checkout Options
v=1 // Version.
&tid=UA-XXXXX-Y // Tracking ID / Property ID.
**&cid=555 // Anonymous Client ID.**
&t=event // Event hit type
&ec=Checkout // Event Category. Required.
&ea=Option // Event Action. Required.
&pa=checkout_option // Product action (checkout_option).
&cos=2 // Checkout step.
&col=FedEx // Checkout step option.
Client ID is how Google Analytics tracks each individual user throughout their multiple sessions. So, yes- if you want that payload to be associated with the same user, then the CID will need to match- otherwise you'll be artificially inflating your user count (as well as severing the contextual data from that user).
You can parse the cookie that GA stores in the browser to obtain the CID and then fill it there. Not sure what language you're writing in, but there are plenty of snippets out there for parsing the GA cookie. You could also store the CID when it is initially generated in your own session data to be used later while offline. For example:
ga(function(tracker) {
var clientId = tracker.get('clientId');
console.log(clientId);
});
You could also provide your own CID from the start that you generate yourself and tell Google Analytics to use. This might be overkill for your situation, but I wanted to mention it as an option.

Custom metric to track email opens

I am trying to track the number of email opens of a mailing.
This mailing is not personalised, so each receiver will get exactly the same email contents.
So far I have found out that I can add a tracking pixel in the mailing, which will send data to GA that a user opened the mail (images were loaded).
Example code:
<img src=”http://www.google-analytics.com/collect?v=1&tid=UA-XXXXXX-X
&cid=EmailOpenTest&t=event&ec=email&ea=open&el=EmailOpenTest
&cs=newsletter&cm=email&cn=Email&cm1=1″ />
'tid' will be our custom tracking ID.
This all works, as when this link is opened the total number of hits increases.
But my question relates to parameter 'cid'. For testing purposes, I have set this here to "EmailOpenTest". But this should be a random/unique ID per user actually. But as the mailing is not personalised, I wonder if it would be possible to track individual users?
Does this mean I have to include javascript in the mail? Would that even work in all email clients? Or are there other options?
All suggestions are welcome.
Assumption: you are using a mail client like Mail Chimp
Assign a unique id to every email on the email list. lets say this unique id is uid
Create a custom dimension in GA, lets name it as Client Mail Id with index say 1
Create the same pixel just like you have created above in the OP.
Add a custom Dimension in the hit as
http://www.google-analytics.com/collect?v=1&tid=UA-XXXXXX-X
&cid=EmailOpenTest&t=event&ec=email&ea=open&el=EmailOpenTest
&cs=newsletter&cm=email&cn=Email&cm1=1&cd1=uid
In place of uid, you actually need to pass the mail list unique id for that email
How it will work
Once the user sends this hit, your unique id will be recorded in custom dimension 1.
Generate a custom report in GA with event category=email & event action=open and add a dimension custom dimension 1.
All the id's displayed there have actually opened the email ;)
PS: It's tried and tested, so won't cause any issue. Also if you don't want to use custom dimensions, you can also send this id in event label or event value
PPS: In any mail client, getting unique value for that email is pretty easy. You can actiually use its position number or add another column for the unique id, then grab that id win the template
The cid is the clientId, an identifier that is used to aggregate pageviews into sessions, and sessions into unique users.
The way to use that in email-tracking would be to capture the client id when a user subscribes to your newsletter and then insert it into the email links. Since your mails are not personalized this will not work.
If you use a random ID you will not be able to link the request from the mail to an existing user. So one way to deal with the problem would be to ignore it - using a constant userId would still give you an event count (the unique events metric might be a little of if users click the link multiple times within a session lifetime).
If for some reason you absolutely need to track these as different users you can set up a redirect - do not send data to ga directly from your mail, instead call a script on your server that inserts a random clientId and then sends the data to Google.

Resources