Expand my Community achievements bar.

SOLVED

Implement 3rd party pixel using standard web conversion using HTML

Avatar

Level 1

-I am trying to implement this 3rd party pixel provided.

-I am supposed to inject this pixel inside the <body> tag. 
-I am provided an ID ( alphanumeric) and Tag ( <img src-"https://xyz.w11c.net/ap?id=alphanumberID&t=marketing" />

-Places to add will be homepage, cart and check out.
How do you create conversion pixel using Adobe Launch?

This is the first time I am using Adobe Launch so any help is appreciated. Thanks

1 Accepted Solution

Avatar

Correct answer by
Community Advisor and Adobe Champion

This can be done fairly easily... I will assume you know how to create your rules with appropriate triggers, so I will focus solely on the Custom Code Action...

 

I have a few of these on our site, and I use a Javascript tag (mostly cause I want to use some extra logic on my calls... )

 

Jennifer_Dungan_0-1683647430270.png

 

 

In the Code Editor, I use something like:

var alphanumberID = _satellite.getVar('alphanumberID');

var PixelConversion = document.createElement('img');
PixelConversion.src='https://xyz.w11c.net/ap?id=' + alphanumberID + '&t=marketing';
document.getElementsByTagName('body')[0].appendChild(PixelConversion);

Basically, I am creating a new element (img), adding a src attribute to it (with some code to inject the ID into the conversion string), then appending the element to the body so that it will trigger.

This assumes that the alphanumericID value changes based on the use / site / etc... so I would use a Data Element (or Data Elements) to provide the value, and pass it into the pixel string... this is one of the benefits of using JS for this, you can keep your ID configs separate... possibly using something like the Lookup Table Utility extension to drive a different id for site/use... or using multiple constant values that applied for each use.... If the ID changes, you don't have to modify the script, you just have to update your Data Element.

 

If the number alphanumeric doesn't need to change, I suppose you could do a simple HTML tag route:

Jennifer_Dungan_1-1683647874753.png

 

and just use:

<img src-"https://xyz.w11c.net/ap?id=123abc&t=marketing" />

directly in the Editor.... I don't use this method much, as I prefer to separate the IDs from the code... 

You can try both methods and see which works better for you.

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor and Adobe Champion

This can be done fairly easily... I will assume you know how to create your rules with appropriate triggers, so I will focus solely on the Custom Code Action...

 

I have a few of these on our site, and I use a Javascript tag (mostly cause I want to use some extra logic on my calls... )

 

Jennifer_Dungan_0-1683647430270.png

 

 

In the Code Editor, I use something like:

var alphanumberID = _satellite.getVar('alphanumberID');

var PixelConversion = document.createElement('img');
PixelConversion.src='https://xyz.w11c.net/ap?id=' + alphanumberID + '&t=marketing';
document.getElementsByTagName('body')[0].appendChild(PixelConversion);

Basically, I am creating a new element (img), adding a src attribute to it (with some code to inject the ID into the conversion string), then appending the element to the body so that it will trigger.

This assumes that the alphanumericID value changes based on the use / site / etc... so I would use a Data Element (or Data Elements) to provide the value, and pass it into the pixel string... this is one of the benefits of using JS for this, you can keep your ID configs separate... possibly using something like the Lookup Table Utility extension to drive a different id for site/use... or using multiple constant values that applied for each use.... If the ID changes, you don't have to modify the script, you just have to update your Data Element.

 

If the number alphanumeric doesn't need to change, I suppose you could do a simple HTML tag route:

Jennifer_Dungan_1-1683647874753.png

 

and just use:

<img src-"https://xyz.w11c.net/ap?id=123abc&t=marketing" />

directly in the Editor.... I don't use this method much, as I prefer to separate the IDs from the code... 

You can try both methods and see which works better for you.

Avatar

Level 1

Thank you for your reply.
Yes, I did see some videos on how to create rules, which was really helpful. I was lost on how to utilize the alphanumericID's, your explanation sure gives me some direction. I will give this a try. Will keep you posted.