Custom goal triggering via Javascript | Community
Skip to main content
September 13, 2017

Custom goal triggering via Javascript

  • September 13, 2017
  • 1 reply
  • 6336 views

Is there away somehow i can tirgger a goal via javascript API by writing custom javascript.

Some thing like

$(".css-class").click(function(){

    //trigger click goal here

   //window.trigger('goal-name');

});

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

sabahatu1546489
Level 2
September 19, 2017

yes thats possible. how have you implemented Adobe Target

via mbox or at.js?

adal3Author
September 19, 2017

Hi sabahatu,

Thanks for replying back.

As i didn’t setup the target for the website. I cannot say for sure.

Client has already set it up. I got the access later.

I think its at.js,

cuz the elements in page have class like “at-element-marker”

and also “at-element-click-tracking” (when click goal is added via “Goal & Settings”)

But when i check the Setup=> Implementation, mbox.js is selected.

To add up,

I have already tried following

<script>

$('a').click(function(){

  adobe.target.trackEvent({'mbox’:’quicklinkclick’})

});

</script>

and added conversion goal to view mbox “quicklinkclick”;

when i check console log in chrome, i got following:

VM768 satellite-59b9eb0164746d4b1b00b18b.js:18

AT: Track event request failed {mbox: "quicklinkclick", params: {…}, timeout: 15000, success: ƒ, error: ƒ} {status: "error", error: "abort"}

sabahatu1546489
Level 2
September 20, 2017

you are on a right track.
I assume you first created this mbox "quicklinkclick" through console and secondly under metrics you selected "viewed an mbox" (Not clicked on mbox)

cheers,

Sabahat