user1994316
user1994316

Reputation: 43

sitecore analytics pdf download tracking

how do I track a pdf download with sitecore page events? I have code which tracks the event from back end but how do you determine whether the link is external, internal or a media link? And how can you determine if media link is pdf?

public void RegisterDownload(string downloadedResourceText, ID itemId)
        {
            if (downloadedResourceText != null)
            {
                if (TrackerEnabled())
                {
                    var page = CurrentPage();

                    page.Register(new PageEventData("Download", _downloadPageEventGuid) { ItemId = itemId.ToGuid(), Data = downloadedResourceText, DataKey = downloadedResourceText, Text = "Resource Downloaded" });
                }
            }
        }

Upvotes: 2

Views: 1710

Answers (1)

Chris Auer
Chris Auer

Reputation: 1445

If you want to do it with Sitecore, just set the event in the Tracking field for the PDF in the media library.

enter image description here

Then it shows up in the experience profile or you can trigger a engagement plan, etc...

enter image description here

If you are looking to do it programmatically, you have to create the details of the event. You just pass in a string of "User did X" to the page event code you have posted. The itemID is the page they were on when they did it. If it was a brochure, you would have "downloaded the brochure for product XYZ".

Some good details of the properties of the page event call can be found here: https://doc.sitecore.net/sitecore_experience_platform/82/digital_marketing/marketing_operations/events/register_a_page_event_programmatically

Upvotes: 7

Related Questions