How to add conversion action for link in banner?

I’m looking to add a conversion action for a link within a static banner in an Answers experience. How would I do this?

Currently I have code like this added to the html.hbs page files:

<div class="Answers-alertBanner">Looking to save time? Click <a href=" insert client link"> here</a> to place an online order!</div>

I know I need to add an event type to track the click but I’m not sure where to add this.

Thank you!

1 Like

Following up on this post and wondering if we ever found a solution? Would love to add a conversion action to a static banner and show that value to the client.

@Jessica_Smith @Hannah_Mussi

Good question!

Triggering a Conversion based on a banner click is actually very easy. You’ll just need to take your original banner:

<div class="Answers-alertBanner">Looking to save time? Click <a href=" insert client link"> here</a> to place an online order!</div>

and add the following onclick parameter to it to call the Conversion Tag when the link is clicked, shown below:

<div class="Answers-alertBanner">Looking to save time? Click <a href=" insert client link" onclick=ytag('conversion', {'cid': {YOUR_CONVERSION_ACTION_ID}, 'cv': {YOUR_CONVERSION_VALUE} });> here</a> to place an online order!</div>

where you can replace {YOUR_CONVERSION_ACTION_ID} with the Conversion Action ID for your Conversion Action and {YOUR_CONVERSION_VALUE} with the your value for the Conversion.

FYI - make sure you have the ytag install in the head of your site shown below:

		<script>
			window.ytagQ = window.ytagQ || [];
			function ytag() {window.ytagQ.push(arguments);}
		</script>
		<script async src="https://assets.sitescdn.net/ytag/ytag.min.js"></script>
	</head>

Thank you @Michael_Peralta! Just wanted to clarify: does the conversion action have to be tag-based? It seems that’s the only way to obtain the conversion id. Also, does the head of the page mean in the headincludes.hbs file?

@Hannah_Mussi Yes the Conversion does have the be tag based, there is currently no way for you to capture “custom” click events.

As far as your second question, yes you can add it to your headincludes.hbs file.

If you’re using Page Builder, you can also add it by going to Header HTML under Settings

If your customer has built their own pages, how you add to head may vary but typically they’ll be a file that you can add any of your tracking tags to.

Mike

1 Like

Hi @Michael_Peralta - I wanted to follow up here to see if there is now a way to capture “custom” click events for this use case.

Thanks!

@Melissa_Kaplan There is still no way to capture custom click events but can you elaborate on what you’re trying to accomplish here?

The response about should answer how you set up a Conversion Action within a banner.

Mike

Hi @Michael_Peralta - I am trying to track clicks/conversions on a static banner.

My understanding based on the above is that the response only applies if you are using tag based conversions. The account I am working on does not have tag based conversions, is there a way to track these clicks in this case?

Thanks,
Melissa

@Melissa_Kaplan Got it - we don’t currently support capturing clicks on Static Banners but if your banner is a vertical powered by an Entity in the Knowledge Graph then Click-Based Actions will capture any clicks for this banner.

Mike

Got it @Michael_Peralta thanks for the response :+1: