web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

Tracking Email Clicks

(1) ShareShare
ReportReport
Posted on by 7

I am using Power Automate to send emails and I would like to track if the email is being opened/any links are being clicked, is this possible? 

 

The contents of the email are autogenerated and links vary every time, I did think about tagging links but since they change every day that would be effort intense (and manual). 

Categories:
I have the same question (0)
  • Verified answer
    leo85 Profile Picture
    609 on at

    Hi @FraserGreen ,

     

    tracking email clicks is not possible with Power Automate.

    Email tracking in general is done by embedding individualized elements (like images) within emails which are loaded from an external server. Then the server tracks which elements are loaded.

     

    Regards,

    Leo

     

    ----------------------------------------

    If my reply answered your question or solved your issue, please mark it as a solution.

    If it helped, please give it a thumbs up.

  • FraserGreen Profile Picture
    7 on at

    No worries, I had assumed that but was hoping for some sort of add-in/technique to do it in. 

     

     

  • planetparker Profile Picture
    17 on at

    It might be worth pointing out that you actually can track email opens with Power Automate.  It requires you to use the pixel image tracking method, coupled with a Power Automate HTTP trigger.  In the HTML of your email, you place the <img> tag with the source set to the URL generated by your Power Automate flow HTTP trigger.  Then in your flow action you return an image blob representation of your single pixel image.  Then elsewhere in that same flow, you can do whatever you want to facilitate logging and tracking.  For example, you can simply add a record to a SharePoint list.  Use of parameters can also help you track specific email campaigns or whatever.

    I got the idea for this from this post about using a similar method to track Power BI report activity:
    PBIPixel.png (1×1) (datachant.com).

     

    Hope that helps.

  • r_voyager Profile Picture
    130 on at

    Hi,

     

    you tried this method? Can you show in working order? 

     

    I'm trying to achieve the same , but don't know how to put this in order.

     

     

  • dataadminaustin Profile Picture
    2 on at

    @r_voyager

    Using some of the ideas from @planetparker, I was able to figure this out and track email opens from Power Automate. This took me 2 separate flows, plus the api link embedded in whatever other flows you send emails from. Here is a sample of the flow:

    dataadminaustin_0-1710941919489.png

     

    There were 2 areas of complication when creating this process.

     

    1. First, you need some unique variable that is consistent in your email and your database, but it has to be embedded in the email so that you can retrieve it when adding the email data to a database or MS list. That is what you should use the "Relative path" for. I used the flow id so that i did not have to create my own unique variable for every email. Plus - when sending an email, you do not have the internet message id or graph message id.
    2. Second, some email clients (outlook mobile app specifically) call the api twice when you first open an email in their app. I created a workaround by converting my email tracking flow to a non-concurrent flow requiring each run to happen separately. Then, I added a check to see if the selected item in the database had been updated in the last 30 seconds. If true, do not update the data with another view, if false, add 1 to the current "Read Count" value.

    You take the url from the "When a HTTP request is received", place it in an img tag as the src (ie. <img src="api address" height="1" width="1">), replace your unique parameter with a value unique to the email, and place it at the bottom of the html email in the flow where you are sending an email from.

     

    Then you need a flow with the trigger "When a new email arrives" (I used when a new email arrives in a shared mailbox v2). In this flow, you add your email data to your database along with the unique id that was embedded into the body if the email previously so that you can search the database when the api is called.

     

    This is simpler than I thought, but it does come with its complications. I would be happy to provide more details and examples if someone comes across this and wants to add this.

  • JoseAntonio22 Profile Picture
    18 on at

    Hi! Could you share more details? I would like to build this cloud flow! It will help me!

     

  • PJS-Data-Admin Profile Picture
    141 on at

    @JoseAntonio22 Are you looking to track email clicks or email views from emails sent through power automate?

  • JoseAntonio22 Profile Picture
    18 on at

    Track emails clicks from emails through power automate!

  • PJS-Data-Admin Profile Picture
    141 on at

    @JoseAntonio22 Sorry for the delay. There are two flows that need to be created in order to track emails click.

    1. One flow will track the emails in your preferred location, I used MS Lists.
    2. The other flow is triggered by the click of the link and will update a column for the specific email.

    Flow 1:

    • Trigger: When a new email arrives in a shared mailbox (v2)
    • PJSDataAdmin_0-1713986234449.png

       

    • It is straight forward, I get all information from the email and track the email data in a MS list.
    • Then, I have a condition the checks if "/linktracking/" exists in the email body. This text is only in emails that have the link tracking link. If it exists, I update the email item and set the "Clicked Status Value" column to "Unclicked" and add the "Flow Run ID" the is embedded in the email body. In order to properly track and append data, you need a consistent id to search by.

    Flow 2:

    • Trigger: When an HTTP request is received
    • In the trigger action card, there is a value called "Relative path". This is what we need to use to pass the link through the url from the flow that sends the email. I use the following:
      • /trackertype/linktracking/emailsubject/{emailsubject}/linkemailmessageid/{linkemailmessageid}/redirecturl/{redirecturl}
    • To pass the url through the flow, we will have to encode when sent and decode it when clicked.
      • Encode expression:
        • replace(replace(replace(replace(outputs('Original_email_link_value'), '/''_slash_'), '.''_dot_'), '?''_qmark_'), ':''_colon_')
      • Decode expression:
        • replace(replace(replace(replace(triggerOutputs()['relativePathParameters']['redirecturl'], '_slash_''/'), '_dot_''.'), '_qmark_''?'), '_colon_'':')
    • PJSDataAdmin_1-1713986897798.png

       

    • In the flow above, we decode the url in the relative path, then we have a "Do until" action that checks database until a match is found since the email link can be clicked before the email is tracked (takes about 1 minute for an email to be tracked.)
    • Then we update the item, set "Click Status Value" to "Clicked" and add one the number of clicks current in the database: add(outputs('Get_item')?['body/ClickCount'], 1)
    • Below gets added into the flow that sends the email, replace the url in the email with the output of "Set email link tracking url value":
    • PJSDataAdmin_2-1713987303420.png

       

    This is a very consolidated description of how this is done so please let me know what questions you have throughout the process. This looks more complicated than it is, but it is fairly simple overall.

  • leo85 Profile Picture
    609 on at

    Hi @PJS-Data-Admin,

    is that parsing not overly complicated for this use case. 

    Instead of parsing the whole url and encoding/decoding it, you can simply utilize the queries parameters of the "When an HTTP request is received" trigger.

    So you could pass something like the following url in the email:

    https://prod-110.westeurope.logic.azure.com:443/workflows/[flowID]/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=[sig]&subject=[Email Subject]&trackingid=[trackingID]

      

    Then the trigger will do the work for you and you can simply access the subject and trackingid via the queries parameter:

    triggerOutputs()?['queries/subject']
    triggerOutputs()?['queries/trackingid']

     

    Regards

     

    ----------------------------------------------------------

    If my answer helped you, please give it a thumbs up.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard