0

I've created some ampscript which will create a Note on the contacts account to let the account owner know this account has been sent an email. Inside the note contains the view_email_url so the account owner can take a look at the email that was sent to them.

The only issue with that is when they open the link to view the email its triggered as an Open on the reports. Is there anything else i can use instead of view_email_url so employees can click on a link to see the email without it triggering as an "Open"?

Below is the script I'm using at the moment:

%%[

IF _messagecontext == "SEND" Then 

var @Job_id, @DE_ID, @AccountID, @Web_Link, @createNote, @currentTime

set @job_id = jobid
set @Web_Link = view_email_url
set @AccountID = Lookup("ENT.Contact_Salesforce_7","AccountId","Contact_ID_18__c", _subscriberkey)

set @currentTime  = Now()
set @currentTime =  format(@currentTime,"dd/MM/yyyy @ hh:mm")

set @DE_ID = Concat(@job_id, '-', @AccountID)

IF IsNull(@AccountID) == "false" THEN

set @notebody = Concat('This customer has had a new email sent to them on ', @currentTime, '. Click on the link below to view the email: ', @Web_Link)

set @createNote = CreateSalesforceObject(
"Note__c", 3, 
"Account__c", @AccountID, 
"Body__c", @notebody,
"Title__c", "New Email Sent To Customer")

UpsertDE("GB_SENT_WEBLINK", 1, "ID", @DE_ID, "JobID", @job_id, "ContactID", _subscriberkey, "AccountID", @AccountID, "Web_Link", @Web_Link, "Email_Sent", NOW(), "NoteID", @createNote)

ELSE

UpsertDE("GB_SENT_WEBLINK", 1, "ID", @DE_ID, "JobID", @job_id, "ContactID", _subscriberkey, "AccountID", @AccountID, "Web_Link", @Web_Link, "Email_Sent", NOW())

ENDIF
EndIF
]%%

Any help would be much appreciated.

New contributor
Mike Walmsley is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

1 Answer 1

2

A pragmatic approach would be to solve this in the email.

Open tracking doesn't happen by default, but only in emails where the "open tracking" code snippet (<custom name="opencounter" type="tracking"/>) is inserted - typically this is done initially on template level and then forgotten about, but you can still get to this / find ways to make it conditional in your usecase.

If you manipulate it inside of your particular email html like this:

%%[
IF _messagecontext != "VAWP" Then 
   ]%%<custom name="opencounter" type="tracking"/>%%[
ENDIF
]%%

reference: https://ampscript.guide/email-data-strings/

, then opens from the view online version the are no longer tracked.

downside: this is obviously also the case for "actual" recipient opens that open through view online link (which sounds like a pretty slim number to me). Especially if you do this only for your particular usecase, I think it is rather negligible.

edit: also - this does not solve the fundamental issue that VAWP (re)generates the email with the available data at the time of VIEW, not necessarily how it looked at the time of send.

If the sendout is based on a data extension that changes frequently, chances are people viewing the email some time later get a different / broken version, not the one that was rendered at the time of send.

Then you have to also consider a sendlog and set up something similar to this:

https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/sendTimeContent.html

2
  • Thanks @Jonas for this, i guess in order to still track genuine VAWP visits from consumers i can edit your code to say something like: ` %%[ IF _messagecontext = "VAWP" AND RequestParameter("internal") == false Then ]%%<custom name="opencounter" type="tracking"/>%%[ ENDIF ]%% ` Then when creating the note i add a url parameter &internal=true at the end. So that way the open tracking wont display when an employee is visiting the VAWP version. Jun 24 at 11:22
  • could be worth a try, but I am not sure that you can use requestParameter on the view online version. if that works, what you say makes sense. just don't say == false but != true because no logic will ever send internal=false, just your custom link would be sending internal=true. so VAWP != true AND internal != true >> everything BUT this combination should track. Jun 24 at 11:44

Your Answer

Mike Walmsley is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.