5

We are using AMPscript HTTPGet to pull in some HTML dynamically. The issue is that the URLs are not being wrapped in ET's tracking so clicks aren't being logged.

10

There are a few parts to this answer.

First, you have to call your ExactTarget support rep and have them enable WRAP HTTPGET URLS for your account.

Second, all URLs in the HTTPGet that you want tracked must be preceeded by httpgetwrap|. So for instance, a full HTML url would look like. <a href="httpgetwrap|http://www.example.com/">. If you do not have the httpgetwrap| in the href, its also possible to use something like this: Replace(@content,'href="http','href="httpgetwrap|http').

Third, when you output the the HTML content, you must wrap it in TreatAsContent().

The full code snippet should look something like this:

%%[
    var @getStatus, @getURL, @content
    set @getURL = "http://www.example.com"
    set @content = HttpGET(@getURL, false, 2, @getStatus)
    set @content = Replace(@content,'href="http','href="httpgetwrap|http')
]%%

%%=TreatAsContent(@content)=%%%

Update: If you are using a user-initiated send, you must have the "track all links" option selected or they will not be wrapped.

2
  • 1
    This is the way we generally do it. I would point out that you're taking out the original http in your replace() line...and there's a couple of extra double-quotes. It should be: set @content = Replace(@content,'href="http','href="httpgetwrap|http') Apr 1 '15 at 13:55
  • 1
    Updated, thanks. I actually didn't use the replace in my production code but added it for anyone who might find it useful. Probably should have actually tested it ;)
    – Jon Sakas
    Apr 1 '15 at 15:35

Your Answer

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.