- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
HI All
I am currently implementing the kickfire for google integration.
In essence the script carries out to Kickfire API calls, one of whcih returns a json from which the dimensions can be extracted and mapped.
Has anyone done this piece of wotk previously?
Solved! Go to Solution.
OK, so gettign the API calls to work was easy.
The code was added to an extention set as a pre-loader, then loading the json values into utag.data variables.
$.getJSON('//api.kickfire.com/gip',function(kfip) { $.getJSON('//api.kickfire.com/v2/company:(all)?ip='+kfip+'&key=-blank-',function(obj) { utag.data['kf_name'] = obj['data'][0]['name']; utag.data['kf_website'] = obj['data'][0]['website'];
The variables show population in utag inspector. However when mapped to GA dimensions or say to push into another variable, the process as undefined.
Not sure what i am missing....
Should i be declaring the utag vars differently?
05-02-2018 07:20 AM - last edited on 05-02-2018 07:22 AM by kathleen_jo
Hi @GavinAttard
I will continue working with you on this via the support ticket you have open.
Once we have reached a solution I'll make sure we share it here for the benefit of other customers.
Hi Folks
So, Thanks to @nathan_fleming it was confirmed that the issue the kick fire variables where not beign passed to GA was due to a race condition.
The solution to this was to create another extention that generated a utag.link event tied specfically to the GA tag UID. A delay of one second was also put on the utag.link function so as to ensure the api call was complete and the variables populated.
So, kickfire API calls as Pre-loader, then a second extention like the below.
setTimeout(function(){utag.link({ ga_event_action : "cd_upload", ga_event_category : "data_load", ga_event_label : "non_interactive", ga_non_interaction : true, kf_name : utag_data['kf_name'], kf_employees : utag_data['kf_employees'], kf_revenue : utag_data['kf_revenue'], kf_sic_code : utag_data['kf_sic_code'], kf_naics_code : utag_data['kf_naics_code'] }, function() { utag.DB("Firing KickFire event"); }, [15]
Not sure if this is the best way to deal with this, so open to any other suggestions on how to best handle this.
Gavin
Hi @GavinAttard
Thanks for following up with the solution.
Hopefully we'll have other users who can share if they are doing this in any other ways.
Great solution @GavinAttard. Thank you for sharing!
Copyright All Rights Reserved © 2008-2023